summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-04-11 19:36:56 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-04-11 19:36:56 +0300
commit525ea066877d82d3a3ed0ed0025866753b794290 (patch)
treebb3809f055c4b70d499b807e11c1547f970d7330 /spec
parentc6701fef0e2082e1adae15adb97c75311115617f (diff)
downloadgitlab-ce-525ea066877d82d3a3ed0ed0025866753b794290.tar.gz
Move permission to create subgroup into GroupPolicy
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/models/user_spec.rb22
-rw-r--r--spec/policies/group_policy_spec.rb3
2 files changed, 2 insertions, 23 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 575b43c3d88..a9e37be1157 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -464,28 +464,6 @@ describe User, models: true do
it { expect(@user2.several_namespaces?).to be_truthy }
end
- describe 'subgroups' do
- let(:group) { create :group }
-
- it 'allows if owner' do
- user = create :user
- group.add_user(user, GroupMember::OWNER)
- expect(user.can_create_subgroup?(group)).to be_truthy
- end
-
- it 'disallows if missing right' do
- user = create(:user, can_create_group: false)
- group.add_user(user, GroupMember::MASTER)
- expect(user.can_create_subgroup?(group)).to be_falsey
- end
-
- it 'disallows if developer' do
- user = create :user
- group.add_user(user, GroupMember::DEVELOPER)
- expect(user.can_create_subgroup?(group)).to be_falsey
- end
- end
-
describe 'namespaced' do
before do
@user = create :user
diff --git a/spec/policies/group_policy_spec.rb b/spec/policies/group_policy_spec.rb
index 5c34ff04152..2077c14ff7a 100644
--- a/spec/policies/group_policy_spec.rb
+++ b/spec/policies/group_policy_spec.rb
@@ -22,7 +22,8 @@ describe GroupPolicy, models: true do
:admin_group,
:admin_namespace,
:admin_group_member,
- :change_visibility_level
+ :change_visibility_level,
+ :create_subgroup
]
end