diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-25 11:57:01 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-25 11:57:01 +0200 |
| commit | c31d48dd250c56164280343a2cbe6ae14bd72a4a (patch) | |
| tree | 7da7fbc4ad8b511e815445c4e6e8b7fe508ee5e2 /spec/models | |
| parent | 2f22874ba6b26c1653bd72d9bcac0bee9e24de8a (diff) | |
| download | gitlab-ce-c31d48dd250c56164280343a2cbe6ae14bd72a4a.tar.gz | |
Allow project creation in scope of group for non-admin but group owners
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/namespace_spec.rb | 10 | ||||
| -rw-r--r-- | spec/models/project_spec.rb | 1 | ||||
| -rw-r--r-- | spec/models/user_spec.rb | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index c2509d21f3f..16ab1b617ff 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -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 diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 4fb5f50c98a..db0d30727b4 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -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 diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 13fa4d1333d..824e8cfb73b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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) } |
