summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/mirrors_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/projects/mirrors_controller_spec.rb')
-rw-r--r--spec/controllers/projects/mirrors_controller_spec.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/spec/controllers/projects/mirrors_controller_spec.rb b/spec/controllers/projects/mirrors_controller_spec.rb
index 3579e4aa2cf..faeade0d737 100644
--- a/spec/controllers/projects/mirrors_controller_spec.rb
+++ b/spec/controllers/projects/mirrors_controller_spec.rb
@@ -39,12 +39,24 @@ describe Projects::MirrorsController do
expect(response).to have_gitlab_http_status(:not_found)
end
- it 'allows requests from an admin user' do
- user.update!(admin: true)
- sign_in(user)
+ context 'when admin mode is enabled', :enable_admin_mode do
+ it 'allows requests from an admin user' do
+ user.update!(admin: true)
+ sign_in(user)
- subject_action
- expect(response).to redirect_to(project_settings_path)
+ subject_action
+ expect(response).to redirect_to(project_settings_path)
+ end
+ end
+
+ context 'when admin mode is disabled' do
+ it 'disallows requests from an admin user' do
+ user.update!(admin: true)
+ sign_in(user)
+
+ subject_action
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
end
end
end