summaryrefslogtreecommitdiff
path: root/spec/controllers/projects/settings
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-03-01 18:15:51 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-03-01 18:18:36 +0100
commite4bb25f04bcbd2249da2ef55b1ce6b3df18d42fe (patch)
tree6d07985e9e094f17e5910c14631840fbf6434046 /spec/controllers/projects/settings
parent7fc88fd76a4cfbf2d7315953853ebe7373da9e40 (diff)
downloadgitlab-ce-e4bb25f04bcbd2249da2ef55b1ce6b3df18d42fe.tar.gz
Update Projects::Settings::CiCdController#reset_cache specs
Diffstat (limited to 'spec/controllers/projects/settings')
-rw-r--r--spec/controllers/projects/settings/ci_cd_controller_spec.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/spec/controllers/projects/settings/ci_cd_controller_spec.rb b/spec/controllers/projects/settings/ci_cd_controller_spec.rb
index 0202149f335..293e76798ae 100644
--- a/spec/controllers/projects/settings/ci_cd_controller_spec.rb
+++ b/spec/controllers/projects/settings/ci_cd_controller_spec.rb
@@ -27,7 +27,7 @@ describe Projects::Settings::CiCdController do
allow(ResetProjectCacheService).to receive_message_chain(:new, :execute).and_return(true)
end
- subject { post :reset_cache, namespace_id: project.namespace, project_id: project }
+ subject { post :reset_cache, namespace_id: project.namespace, project_id: project, format: :json }
it 'calls reset project cache service' do
expect(ResetProjectCacheService).to receive_message_chain(:new, :execute)
@@ -35,19 +35,11 @@ describe Projects::Settings::CiCdController do
subject
end
- it 'redirects to project pipelines path' do
- subject
-
- expect(response).to have_gitlab_http_status(:redirect)
- expect(response).to redirect_to(project_pipelines_path(project))
- end
-
context 'when service returns successfully' do
- it 'sets the flash notice variable' do
+ it 'returns a success header' do
subject
- expect(controller).to set_flash[:notice]
- expect(controller).not_to set_flash[:error]
+ expect(response).to have_gitlab_http_status(:ok)
end
end
@@ -56,11 +48,10 @@ describe Projects::Settings::CiCdController do
allow(ResetProjectCacheService).to receive_message_chain(:new, :execute).and_return(false)
end
- it 'sets the flash error variable' do
+ it 'returns an error header' do
subject
- expect(controller).not_to set_flash[:notice]
- expect(controller).to set_flash[:error]
+ expect(response).to have_gitlab_http_status(:bad_request)
end
end
end