diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 21:09:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-14 21:09:54 +0300 |
commit | f697dc5e76dfc5894df006d53b2b7e751653cf05 (patch) | |
tree | 1387cd225039e611f3683f96b318bb17d4c422cb /spec/controllers/groups | |
parent | 874ead9c3a50de4c4ca4551eaf5b7eb976d26b50 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/groups')
-rw-r--r-- | spec/controllers/groups/settings/ci_cd_controller_spec.rb | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/spec/controllers/groups/settings/ci_cd_controller_spec.rb b/spec/controllers/groups/settings/ci_cd_controller_spec.rb index b5154f4f877..b2ae16e0ee6 100644 --- a/spec/controllers/groups/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/groups/settings/ci_cd_controller_spec.rb @@ -180,32 +180,38 @@ describe Groups::Settings::CiCdController do group.add_owner(user) end - it { is_expected.to redirect_to(group_settings_ci_cd_path) } + context 'when admin mode is disabled' do + it { is_expected.to have_gitlab_http_status(:not_found) } + end - context 'when service execution went wrong' do - let(:update_service) { double } + context 'when admin mode is enabled', :enable_admin_mode do + it { is_expected.to redirect_to(group_settings_ci_cd_path) } - before do - allow(Groups::UpdateService).to receive(:new).and_return(update_service) - allow(update_service).to receive(:execute).and_return(false) - allow_any_instance_of(Group).to receive_message_chain(:errors, :full_messages) - .and_return(['Error 1']) + context 'when service execution went wrong' do + let(:update_service) { double } - subject - end + before do + allow(Groups::UpdateService).to receive(:new).and_return(update_service) + allow(update_service).to receive(:execute).and_return(false) + allow_any_instance_of(Group).to receive_message_chain(:errors, :full_messages) + .and_return(['Error 1']) - it 'returns a flash alert' do - expect(response).to set_flash[:alert] - .to eq("There was a problem updating the pipeline settings: [\"Error 1\"].") + subject + end + + it 'returns a flash alert' do + expect(response).to set_flash[:alert] + .to eq("There was a problem updating the pipeline settings: [\"Error 1\"].") + end end - end - context 'when service execution was successful' do - it 'returns a flash notice' do - subject + context 'when service execution was successful' do + it 'returns a flash notice' do + subject - expect(response).to set_flash[:notice] - .to eq('Pipeline settings was updated for the group') + expect(response).to set_flash[:notice] + .to eq('Pipeline settings was updated for the group') + end end end end |