summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFabio Papa <fabtheman@gmail.com>2019-06-28 08:35:09 -0700
committerFabio Papa <fabtheman@gmail.com>2019-07-02 11:36:03 -0700
commit770e3de7d613d2c87c33bbc993ca5cec1eda4635 (patch)
tree12bba65536f948f5da08f986451d74a330597070 /spec
parent7c7a94f2088ee2687bc21434371c6b27ae56bd1b (diff)
downloadgitlab-ce-770e3de7d613d2c87c33bbc993ca5cec1eda4635.tar.gz
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.
Diffstat (limited to 'spec')
-rw-r--r--spec/features/groups/show_spec.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index 2654d06cd8c..68fa3f4e817 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -86,7 +86,7 @@ describe 'Group show page' do
visit path
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)
end
end
@@ -103,8 +103,22 @@ describe 'Group show page' do
visit path
end
- it 'allows creating subgroups' do
- expect(page).to have_css("li[data-text='New subgroup']", visible: false)
+ 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
+ visit path
+ expect(page).to have_css("li[data-text='New subgroup']", visible: false)
+ 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
@@ -114,7 +128,7 @@ describe 'Group show page' do
visit path
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)
end
end