Commit 5156a304 authored by Fabio Papa's avatar Fabio Papa

Add failing unit test specifying a maintainer creating a subgroup

parent 0a5346bf
# 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment