diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 18:09:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 18:09:54 +0000 |
commit | f697dc5e76dfc5894df006d53b2b7e751653cf05 (patch) | |
tree | 1387cd225039e611f3683f96b318bb17d4c422cb /spec/controllers/projects/mirrors_controller_spec.rb | |
parent | 874ead9c3a50de4c4ca4551eaf5b7eb976d26b50 (diff) | |
download | gitlab-ce-f697dc5e76dfc5894df006d53b2b7e751653cf05.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/projects/mirrors_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/mirrors_controller_spec.rb | 22 |
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 |