Add failing unit test specifying a maintainer creating a subgroup
This commit is contained in:
parent
0a5346bf11
commit
5156a30440
2 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
# coding: utf-8
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
@ -87,6 +88,14 @@ describe Groups::CreateService, '#execute' do
|
|||
|
||||
it { is_expected.to be_persisted }
|
||||
end
|
||||
|
||||
context 'as maintainer' do
|
||||
before do
|
||||
group.add_maintainer(user)
|
||||
end
|
||||
|
||||
it { is_expected.to be_persisted }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -23,6 +23,15 @@ RSpec.shared_context 'GroupPolicy context' do
|
|||
create_projects
|
||||
read_cluster create_cluster update_cluster admin_cluster add_cluster
|
||||
]
|
||||
[
|
||||
:create_projects,
|
||||
:read_cluster,
|
||||
:create_cluster,
|
||||
:update_cluster,
|
||||
:admin_cluster,
|
||||
:add_cluster,
|
||||
(Gitlab::Database.postgresql? ? :create_subgroup : nil)
|
||||
].compact
|
||||
end
|
||||
let(:owner_permissions) do
|
||||
[
|
||||
|
@ -30,8 +39,7 @@ RSpec.shared_context 'GroupPolicy context' do
|
|||
:admin_namespace,
|
||||
:admin_group_member,
|
||||
:change_visibility_level,
|
||||
:set_note_created_at,
|
||||
(Gitlab::Database.postgresql? ? :create_subgroup : nil)
|
||||
:set_note_created_at
|
||||
].compact
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue