Allow project creation in scope of group for non-admin but group owners

This commit is contained in:
Dmitriy Zaporozhets 2012-11-25 11:57:01 +02:00
parent 2f22874ba6
commit c31d48dd25
7 changed files with 62 additions and 13 deletions

View file

@ -22,4 +22,14 @@ describe Namespace do
it { should validate_presence_of :path }
it { should validate_uniqueness_of(:path) }
it { should validate_presence_of :owner }
describe "Mass assignment" do
it { should allow_mass_assignment_of(:name) }
it { should allow_mass_assignment_of(:path) }
end
describe "Respond to" do
it { should respond_to(:human_name) }
it { should respond_to(:to_param) }
end
end

View file

@ -40,6 +40,7 @@ describe Project do
end
describe "Mass assignment" do
it { should_not allow_mass_assignment_of(:namespace_id) }
it { should_not allow_mass_assignment_of(:owner_id) }
it { should_not allow_mass_assignment_of(:private_flag) }
end

View file

@ -40,6 +40,7 @@ describe User do
it { should have_one(:namespace) }
it { should have_many(:users_projects).dependent(:destroy) }
it { should have_many(:projects) }
it { should have_many(:groups) }
it { should have_many(:my_own_projects).class_name('Project') }
it { should have_many(:keys).dependent(:destroy) }
it { should have_many(:events).class_name('Event').dependent(:destroy) }