diff options
Diffstat (limited to 'spec/controllers/projects/jobs_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/jobs_controller_spec.rb | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index fdd7e6f173f..f9688949a19 100644 --- a/spec/controllers/projects/jobs_controller_spec.rb +++ b/spec/controllers/projects/jobs_controller_spec.rb @@ -20,7 +20,7 @@ describe Projects::JobsController do end it 'has only pending builds' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:builds).first.status).to eq('pending') end end @@ -33,7 +33,7 @@ describe Projects::JobsController do end it 'has only running jobs' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:builds).first.status).to eq('running') end end @@ -46,7 +46,7 @@ describe Projects::JobsController do end it 'has only finished jobs' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:builds).first.status).to eq('success') end end @@ -62,7 +62,7 @@ describe Projects::JobsController do end it 'redirects to the page' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:builds).current_page).to eq(last_page) end end @@ -107,7 +107,7 @@ describe Projects::JobsController do end it 'has a job' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:build).id).to eq(job.id) end end @@ -118,7 +118,7 @@ describe Projects::JobsController do end it 'renders not_found' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -136,7 +136,7 @@ describe Projects::JobsController do end it 'exposes needed information' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['raw_path']).to match(/jobs\/\d+\/raw\z/) expect(json_response.dig('merge_request', 'path')).to match(/merge_requests\/\d+\z/) expect(json_response['new_issue_path']) @@ -163,7 +163,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :trace, pipeline: pipeline) } it 'returns a trace' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['id']).to eq job.id expect(json_response['status']).to eq job.status expect(json_response['html']).to eq('BUILD TRACE') @@ -174,7 +174,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, pipeline: pipeline) } it 'returns no traces' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['id']).to eq job.id expect(json_response['status']).to eq job.status expect(json_response['html']).to be_nil @@ -185,7 +185,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :unicode_trace, pipeline: pipeline) } it 'returns a trace with Unicode' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['id']).to eq job.id expect(json_response['status']).to eq job.status expect(json_response['html']).to include("ヾ(´༎ຶД༎ຶ`)ノ") @@ -212,11 +212,11 @@ describe Projects::JobsController do end it 'return a detailed job status in json' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response['text']).to eq status.text expect(json_response['label']).to eq status.label expect(json_response['icon']).to eq status.icon - expect(json_response['favicon']).to eq "/assets/ci_favicons/#{status.favicon}.ico" + expect(json_response['favicon']).to match_asset_path "/assets/ci_favicons/#{status.favicon}.ico" end end @@ -232,7 +232,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :retryable, pipeline: pipeline) } it 'redirects to the retried job page' do - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(response).to redirect_to(namespace_project_job_path(id: Ci::Build.last.id)) end end @@ -241,7 +241,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, pipeline: pipeline) } it 'renders unprocessable_entity' do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -268,7 +268,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :playable, pipeline: pipeline) } it 'redirects to the played job page' do - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(response).to redirect_to(namespace_project_job_path(id: job.id)) end @@ -281,7 +281,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, pipeline: pipeline) } it 'renders unprocessable_entity' do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -304,7 +304,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :cancelable, pipeline: pipeline) } it 'redirects to the canceled job page' do - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(response).to redirect_to(namespace_project_job_path(id: job.id)) end @@ -317,7 +317,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :canceled, pipeline: pipeline) } it 'returns unprocessable_entity' do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -342,7 +342,7 @@ describe Projects::JobsController do end it 'redirects to a index page' do - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(response).to redirect_to(namespace_project_jobs_path) end @@ -359,7 +359,7 @@ describe Projects::JobsController do end it 'redirects to a index page' do - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(response).to redirect_to(namespace_project_jobs_path) end end @@ -382,7 +382,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :erasable, :trace, pipeline: pipeline) } it 'redirects to the erased job page' do - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(response).to redirect_to(namespace_project_job_path(id: job.id)) end @@ -400,7 +400,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :erased, pipeline: pipeline) } it 'returns unprocessable_entity' do - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_gitlab_http_status(:unprocessable_entity) end end @@ -420,7 +420,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, :trace, pipeline: pipeline) } it 'send a trace file' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response.content_type).to eq 'text/plain; charset=utf-8' expect(response.body).to eq 'BUILD TRACE' end @@ -430,7 +430,7 @@ describe Projects::JobsController do let(:job) { create(:ci_build, pipeline: pipeline) } it 'returns not_found' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end |