Commit 308769d1 authored by Fabio Papa's avatar Fabio Papa

Add feature examples specing maintainers creating subgroups

Both with subgroup_creation_level set to owners and to maintainers.
Also fixed the naming of some other examples in the same spec as they
were contradicting what they were actually performing in the test.
These examples were probably copy/pasted, and not renamed.
parent 412c86b9
...@@ -86,7 +86,7 @@ describe 'Group show page' do ...@@ -86,7 +86,7 @@ describe 'Group show page' do
visit path visit path
end end
it 'allows creating subgroups' do it 'does not allow creating subgroups' do
expect(page).not_to have_selector("li[data-text='New subgroup']", visible: false) expect(page).not_to have_selector("li[data-text='New subgroup']", visible: false)
end end
end end
...@@ -103,18 +103,32 @@ describe 'Group show page' do ...@@ -103,18 +103,32 @@ describe 'Group show page' do
visit path visit path
end end
context 'when subgroup_creation_level is set to maintainer' do
let(:group) { create(:group, subgroup_creation_level: ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS) }
it 'allows creating subgroups' do it 'allows creating subgroups' do
visit path
expect(page).to have_css("li[data-text='New subgroup']", visible: false) expect(page).to have_css("li[data-text='New subgroup']", visible: false)
end end
end end
context 'when subgroup_creation_level is set to owners' do
let(:group) { create(:group, subgroup_creation_level: ::Gitlab::Access::OWNER_SUBGROUP_ACCESS) }
it 'does not allow creating subgroups' do
visit path
expect(page).not_to have_css("li[data-text='New subgroup']", visible: false)
end
end
end
context 'when subgroups are not supported' do context 'when subgroups are not supported' do
before do before do
allow(Group).to receive(:supports_nested_objects?) { false } allow(Group).to receive(:supports_nested_objects?) { false }
visit path visit path
end end
it 'allows creating subgroups' do it 'does not allow creating subgroups' do
expect(page).not_to have_selector("li[data-text='New subgroup']", visible: false) expect(page).not_to have_selector("li[data-text='New subgroup']", visible: false)
end end
end 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