summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFabio Papa <fabtheman@gmail.com>2019-06-30 14:40:23 -0700
committerFabio Papa <fabtheman@gmail.com>2019-07-19 12:06:56 -0700
commit44bd74cd0e87c36a99fb5ac2723f44bccf3dfbb9 (patch)
treed8ffdc6aa10f2dae965346a9370d2cd49e0bf264 /spec
parentaa428bef4e291efe5d346d7df7bbe0028397d90f (diff)
downloadgitlab-ce-44bd74cd0e87c36a99fb5ac2723f44bccf3dfbb9.tar.gz
Make subgroup_creation_level default to maintainer at SQL level
- Migration updates existing groups to "owner", then sets default to "maintainer" so that new groups will default to that - Update spec examples
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/admin/groups_controller_spec.rb2
-rw-r--r--spec/factories/groups.rb1
-rw-r--r--spec/requests/api/groups_spec.rb4
3 files changed, 3 insertions, 4 deletions
diff --git a/spec/controllers/admin/groups_controller_spec.rb b/spec/controllers/admin/groups_controller_spec.rb
index 451367f58e1..34cd0b324b5 100644
--- a/spec/controllers/admin/groups_controller_spec.rb
+++ b/spec/controllers/admin/groups_controller_spec.rb
@@ -70,7 +70,7 @@ describe Admin::GroupsController do
end
it 'updates the subgroup_creation_level successfully' do
- MAINTAINER = ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS
+ OWNER = ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
expect do
post :update,
diff --git a/spec/factories/groups.rb b/spec/factories/groups.rb
index 947392b4fbc..b67ab955ffc 100644
--- a/spec/factories/groups.rb
+++ b/spec/factories/groups.rb
@@ -5,7 +5,6 @@ FactoryBot.define do
type 'Group'
owner nil
project_creation_level ::Gitlab::Access::MAINTAINER_PROJECT_ACCESS
- subgroup_creation_level ::Gitlab::Access::OWNER_SUBGROUP_ACCESS
after(:create) do |group|
if group.owner
diff --git a/spec/requests/api/groups_spec.rb b/spec/requests/api/groups_spec.rb
index c41408fba65..52d926d5484 100644
--- a/spec/requests/api/groups_spec.rb
+++ b/spec/requests/api/groups_spec.rb
@@ -803,10 +803,10 @@ describe API::Groups do
group2.add_maintainer(user1)
end
- it 'cannot create subgroups' do
+ it 'can create subgroups' do
post api("/groups", user1), params: { parent_id: group2.id, name: 'foo', path: 'foo' }
- expect(response).to have_gitlab_http_status(403)
+ expect(response).to have_gitlab_http_status(201)
end
end
end