summaryrefslogtreecommitdiff
path: root/spec/features/groups_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/groups_spec.rb')
-rw-r--r--spec/features/groups_spec.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb
index c9a0844932a..28b22860f0a 100644
--- a/spec/features/groups_spec.rb
+++ b/spec/features/groups_spec.rb
@@ -143,7 +143,7 @@ RSpec.describe 'Group' do
end
end
- describe 'create a nested group', :js do
+ describe 'create a nested group' do
let_it_be(:group) { create(:group, path: 'foo') }
context 'as admin' do
@@ -153,13 +153,21 @@ RSpec.describe 'Group' do
visit new_group_path(group, parent_id: group.id)
end
- it 'creates a nested group' do
- fill_in 'Group name', with: 'bar'
- fill_in 'Group URL', with: 'bar'
- click_button 'Create group'
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it 'creates a nested group' do
+ fill_in 'Group name', with: 'bar'
+ fill_in 'Group URL', with: 'bar'
+ click_button 'Create group'
- expect(current_path).to eq(group_path('foo/bar'))
- expect(page).to have_content("Group 'bar' was successfully created.")
+ expect(current_path).to eq(group_path('foo/bar'))
+ expect(page).to have_content("Group 'bar' was successfully created.")
+ end
+ end
+
+ context 'when admin mode is disabled' do
+ it 'is not allowed' do
+ expect(page).to have_gitlab_http_status(:not_found)
+ end
end
end