Move directory with project. Fixed all related path methods to use namespace
This commit is contained in:
parent
e29ccece33
commit
71214bee75
9 changed files with 55 additions and 10 deletions
|
@ -29,10 +29,14 @@ FactoryGirl.define do
|
|||
owner
|
||||
end
|
||||
|
||||
factory :group do
|
||||
factory :namespace do
|
||||
sequence(:name) { |n| "group#{n}" }
|
||||
code { name.downcase.gsub(/\s/, '_') }
|
||||
owner
|
||||
|
||||
factory :group do
|
||||
type 'Group'
|
||||
end
|
||||
end
|
||||
|
||||
factory :users_project do
|
||||
|
|
12
spec/models/namespace_spec.rb
Normal file
12
spec/models/namespace_spec.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Namespace do
|
||||
let!(:namespace) { create(:namespace) }
|
||||
|
||||
it { should have_many :projects }
|
||||
it { should validate_presence_of :name }
|
||||
it { should validate_uniqueness_of(:name) }
|
||||
it { should validate_presence_of :code }
|
||||
it { should validate_uniqueness_of(:code) }
|
||||
it { should validate_presence_of :owner }
|
||||
end
|
|
@ -24,6 +24,7 @@ require 'spec_helper'
|
|||
describe Project do
|
||||
describe "Associations" do
|
||||
it { should belong_to(:group) }
|
||||
it { should belong_to(:namespace) }
|
||||
it { should belong_to(:owner).class_name('User') }
|
||||
it { should have_many(:users) }
|
||||
it { should have_many(:events).dependent(:destroy) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue