diff options
Diffstat (limited to 'spec/requests/api/pipeline_schedules_spec.rb')
-rw-r--r-- | spec/requests/api/pipeline_schedules_spec.rb | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/spec/requests/api/pipeline_schedules_spec.rb b/spec/requests/api/pipeline_schedules_spec.rb index f650df57383..7ea25059756 100644 --- a/spec/requests/api/pipeline_schedules_spec.rb +++ b/spec/requests/api/pipeline_schedules_spec.rb @@ -20,7 +20,7 @@ describe API::PipelineSchedules do it 'returns list of pipeline_schedules' do get api("/projects/#{project.id}/pipeline_schedules", developer) - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(response).to match_response_schema('pipeline_schedules') end @@ -67,7 +67,7 @@ describe API::PipelineSchedules do it 'does not return pipeline_schedules list' do get api("/projects/#{project.id}/pipeline_schedules", user) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -75,7 +75,7 @@ describe API::PipelineSchedules do it 'does not return pipeline_schedules list' do get api("/projects/#{project.id}/pipeline_schedules") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -91,14 +91,14 @@ describe API::PipelineSchedules do it 'returns pipeline_schedule details' do get api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", developer) - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('pipeline_schedule') end it 'responds with 404 Not Found if requesting non-existing pipeline_schedule' do get api("/projects/#{project.id}/pipeline_schedules/-5", developer) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -106,7 +106,7 @@ describe API::PipelineSchedules do it 'does not return pipeline_schedules list' do get api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", user) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -118,7 +118,7 @@ describe API::PipelineSchedules do it 'does not return pipeline_schedules list' do get api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", user) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -126,7 +126,7 @@ describe API::PipelineSchedules do it 'does not return pipeline_schedules list' do get api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -142,7 +142,7 @@ describe API::PipelineSchedules do params end.to change { project.pipeline_schedules.count }.by(1) - expect(response).to have_http_status(:created) + expect(response).to have_gitlab_http_status(:created) expect(response).to match_response_schema('pipeline_schedule') expect(json_response['description']).to eq(params[:description]) expect(json_response['ref']).to eq(params[:ref]) @@ -156,7 +156,7 @@ describe API::PipelineSchedules do it 'does not create pipeline_schedule' do post api("/projects/#{project.id}/pipeline_schedules", developer) - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) end end @@ -165,7 +165,7 @@ describe API::PipelineSchedules do post api("/projects/#{project.id}/pipeline_schedules", developer), params.merge('cron' => 'invalid-cron') - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) expect(json_response['message']).to have_key('cron') end end @@ -175,7 +175,7 @@ describe API::PipelineSchedules do it 'does not create pipeline_schedule' do post api("/projects/#{project.id}/pipeline_schedules", user), params - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -183,7 +183,7 @@ describe API::PipelineSchedules do it 'does not create pipeline_schedule' do post api("/projects/#{project.id}/pipeline_schedules"), params - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -198,7 +198,7 @@ describe API::PipelineSchedules do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", developer), cron: '1 2 3 4 *' - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('pipeline_schedule') expect(json_response['cron']).to eq('1 2 3 4 *') end @@ -208,7 +208,7 @@ describe API::PipelineSchedules do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", developer), cron: 'invalid-cron' - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) expect(json_response['message']).to have_key('cron') end end @@ -218,7 +218,7 @@ describe API::PipelineSchedules do it 'does not update pipeline_schedule' do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", user) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -226,7 +226,7 @@ describe API::PipelineSchedules do it 'does not update pipeline_schedule' do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -240,7 +240,7 @@ describe API::PipelineSchedules do it 'updates owner' do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/take_ownership", developer) - expect(response).to have_http_status(:created) + expect(response).to have_gitlab_http_status(:created) expect(response).to match_response_schema('pipeline_schedule') end end @@ -249,7 +249,7 @@ describe API::PipelineSchedules do it 'does not update owner' do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/take_ownership", user) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -257,7 +257,7 @@ describe API::PipelineSchedules do it 'does not update owner' do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/take_ownership") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -279,13 +279,13 @@ describe API::PipelineSchedules do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", master) end.to change { project.pipeline_schedules.count }.by(-1) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) end it 'responds with 404 Not Found if requesting non-existing pipeline_schedule' do delete api("/projects/#{project.id}/pipeline_schedules/-5", master) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end it_behaves_like '412 response' do @@ -299,7 +299,7 @@ describe API::PipelineSchedules do it 'does not delete pipeline_schedule' do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", developer) - expect(response).to have_http_status(:forbidden) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -307,7 +307,7 @@ describe API::PipelineSchedules do it 'does not delete pipeline_schedule' do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -327,7 +327,7 @@ describe API::PipelineSchedules do params end.to change { pipeline_schedule.variables.count }.by(1) - expect(response).to have_http_status(:created) + expect(response).to have_gitlab_http_status(:created) expect(response).to match_response_schema('pipeline_schedule_variable') expect(json_response['key']).to eq(params[:key]) expect(json_response['value']).to eq(params[:value]) @@ -338,7 +338,7 @@ describe API::PipelineSchedules do it 'does not create pipeline_schedule_variable' do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables", developer) - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) end end @@ -347,7 +347,7 @@ describe API::PipelineSchedules do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables", developer), params.merge('key' => '!?!?') - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) expect(json_response['message']).to have_key('key') end end @@ -357,7 +357,7 @@ describe API::PipelineSchedules do it 'does not create pipeline_schedule_variable' do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables", user), params - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -365,7 +365,7 @@ describe API::PipelineSchedules do it 'does not create pipeline_schedule_variable' do post api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables"), params - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -384,7 +384,7 @@ describe API::PipelineSchedules do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/#{pipeline_schedule_variable.key}", developer), value: 'updated_value' - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('pipeline_schedule_variable') expect(json_response['value']).to eq('updated_value') end @@ -394,7 +394,7 @@ describe API::PipelineSchedules do it 'does not update pipeline_schedule_variable' do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/#{pipeline_schedule_variable.key}", user) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -402,7 +402,7 @@ describe API::PipelineSchedules do it 'does not update pipeline_schedule_variable' do put api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/#{pipeline_schedule_variable.key}") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end @@ -428,14 +428,14 @@ describe API::PipelineSchedules do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/#{pipeline_schedule_variable.key}", master) end.to change { Ci::PipelineScheduleVariable.count }.by(-1) - expect(response).to have_http_status(:accepted) + expect(response).to have_gitlab_http_status(:accepted) expect(response).to match_response_schema('pipeline_schedule_variable') end it 'responds with 404 Not Found if requesting non-existing pipeline_schedule_variable' do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/____", master) - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -445,7 +445,7 @@ describe API::PipelineSchedules do it 'does not delete pipeline_schedule_variable' do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/#{pipeline_schedule_variable.key}", developer) - expect(response).to have_http_status(:forbidden) + expect(response).to have_gitlab_http_status(:forbidden) end end @@ -453,7 +453,7 @@ describe API::PipelineSchedules do it 'does not delete pipeline_schedule_variable' do delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}/variables/#{pipeline_schedule_variable.key}") - expect(response).to have_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:unauthorized) end end end |