From 2f40dac35280f9de9af8c47bdf85c2f0b2d53680 Mon Sep 17 00:00:00 2001 From: Jacopo Date: Thu, 19 Oct 2017 20:28:19 +0200 Subject: Refactor `have_http_status` into `have_gitlab_http_status` in the specs --- .../projects/artifacts_controller_spec.rb | 8 ++-- .../controllers/projects/badges_controller_spec.rb | 4 +- spec/controllers/projects/blame_controller_spec.rb | 2 +- spec/controllers/projects/blob_controller_spec.rb | 4 +- .../controllers/projects/boards_controller_spec.rb | 6 +-- .../projects/branches_controller_spec.rb | 28 ++++++------- .../projects/clusters_controller_spec.rb | 14 +++---- .../controllers/projects/commit_controller_spec.rb | 12 +++--- .../projects/compare_controller_spec.rb | 8 ++-- .../projects/deployments_controller_spec.rb | 4 +- .../projects/discussions_controller_spec.rb | 12 +++--- .../projects/environments_controller_spec.rb | 26 ++++++------ spec/controllers/projects/forks_controller_spec.rb | 4 +- .../controllers/projects/issues_controller_spec.rb | 44 ++++++++++----------- spec/controllers/projects/jobs_controller_spec.rb | 46 +++++++++++----------- .../controllers/projects/labels_controller_spec.rb | 18 ++++----- .../projects/mattermosts_controller_spec.rb | 2 +- .../merge_requests/conflicts_controller_spec.rb | 16 ++++---- .../merge_requests/creations_controller_spec.rb | 2 +- .../merge_requests/diffs_controller_spec.rb | 8 ++-- .../projects/merge_requests_controller_spec.rb | 14 +++---- .../projects/milestones_controller_spec.rb | 2 +- spec/controllers/projects/notes_controller_spec.rb | 38 +++++++++--------- spec/controllers/projects/pages_controller_spec.rb | 10 ++--- .../projects/pages_domains_controller_spec.rb | 12 +++--- .../projects/pipeline_schedules_controller_spec.rb | 16 ++++---- .../projects/pipelines_controller_spec.rb | 18 ++++----- .../projects/pipelines_settings_controller_spec.rb | 2 +- .../projects/project_members_controller_spec.rb | 16 ++++---- .../projects/prometheus_controller_spec.rb | 6 +-- spec/controllers/projects/raw_controller_spec.rb | 10 ++--- .../registry/repositories_controller_spec.rb | 12 +++--- .../projects/registry/tags_controller_spec.rb | 6 +-- .../projects/repositories_controller_spec.rb | 2 +- .../projects/runners_controller_spec.rb | 8 ++-- .../projects/services_controller_spec.rb | 2 +- .../projects/settings/ci_cd_controller_spec.rb | 2 +- .../settings/integrations_controller_spec.rb | 2 +- .../settings/repository_controller_spec.rb | 2 +- .../projects/snippets_controller_spec.rb | 18 ++++----- spec/controllers/projects/todos_controller_spec.rb | 20 +++++----- spec/controllers/projects/tree_controller_spec.rb | 2 +- .../projects/uploads_controller_spec.rb | 22 +++++------ .../projects/variables_controller_spec.rb | 2 +- 44 files changed, 256 insertions(+), 256 deletions(-) (limited to 'spec/controllers/projects') diff --git a/spec/controllers/projects/artifacts_controller_spec.rb b/spec/controllers/projects/artifacts_controller_spec.rb index d0992719171..d1051741430 100644 --- a/spec/controllers/projects/artifacts_controller_spec.rb +++ b/spec/controllers/projects/artifacts_controller_spec.rb @@ -60,7 +60,7 @@ describe Projects::ArtifactsController do it 'renders the file view' do get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt' - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -78,7 +78,7 @@ describe Projects::ArtifactsController do it 'renders the file view' do get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt' - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to render_template('projects/artifacts/file') end end @@ -106,7 +106,7 @@ describe Projects::ArtifactsController do it 'does not redirect the request' do get :file, namespace_id: private_project.namespace, project_id: private_project, job_id: job, path: 'ci_artifacts.txt' - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to render_template('projects/artifacts/file') end end @@ -143,7 +143,7 @@ describe Projects::ArtifactsController do context 'cannot find the job' do shared_examples 'not found' do - it { expect(response).to have_http_status(:not_found) } + it { expect(response).to have_gitlab_http_status(:not_found) } end context 'has no such ref' do diff --git a/spec/controllers/projects/badges_controller_spec.rb b/spec/controllers/projects/badges_controller_spec.rb index d68200164e4..e7cddf8cfbf 100644 --- a/spec/controllers/projects/badges_controller_spec.rb +++ b/spec/controllers/projects/badges_controller_spec.rb @@ -13,13 +13,13 @@ describe Projects::BadgesController do it 'requests the pipeline badge successfully' do get_badge(:pipeline) - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end it 'requests the coverage badge successfully' do get_badge(:coverage) - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end def get_badge(badge) diff --git a/spec/controllers/projects/blame_controller_spec.rb b/spec/controllers/projects/blame_controller_spec.rb index c086b386381..54282aa4001 100644 --- a/spec/controllers/projects/blame_controller_spec.rb +++ b/spec/controllers/projects/blame_controller_spec.rb @@ -28,7 +28,7 @@ describe Projects::BlameController do context "invalid file" do let(:id) { 'master/files/ruby/missing_file.rb'} - it { expect(response).to have_http_status(404) } + it { expect(response).to have_gitlab_http_status(404) } end end end diff --git a/spec/controllers/projects/blob_controller_spec.rb b/spec/controllers/projects/blob_controller_spec.rb index fb76b7fdf38..6a1c07b4a0b 100644 --- a/spec/controllers/projects/blob_controller_spec.rb +++ b/spec/controllers/projects/blob_controller_spec.rb @@ -153,7 +153,7 @@ describe Projects::BlobController do end it 'redirects to blob show' do - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -167,7 +167,7 @@ describe Projects::BlobController do end it 'redirects to blob show' do - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end diff --git a/spec/controllers/projects/boards_controller_spec.rb b/spec/controllers/projects/boards_controller_spec.rb index 9e2e9a39481..84cde33d944 100644 --- a/spec/controllers/projects/boards_controller_spec.rb +++ b/spec/controllers/projects/boards_controller_spec.rb @@ -45,7 +45,7 @@ describe Projects::BoardsController do it 'returns a not found 404 response' do list_boards - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -85,7 +85,7 @@ describe Projects::BoardsController do it 'returns a not found 404 response' do read_board board: board - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -95,7 +95,7 @@ describe Projects::BoardsController do read_board board: another_board - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb index 3b3b63444c7..973d6fed288 100644 --- a/spec/controllers/projects/branches_controller_spec.rb +++ b/spec/controllers/projects/branches_controller_spec.rb @@ -128,7 +128,7 @@ describe Projects::BranchesController do issue_iid: issue.iid expect(response.location).to include(project_new_blob_path(project, branch)) - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -161,7 +161,7 @@ describe Projects::BranchesController do it 'returns a successful 200 response' do create_branch name: 'my-branch', ref: 'master' - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'returns the created branch' do @@ -175,7 +175,7 @@ describe Projects::BranchesController do it 'returns an unprocessable entity 422 response' do create_branch name: "", ref: "" - expect(response).to have_http_status(422) + expect(response).to have_gitlab_http_status(422) end end @@ -202,7 +202,7 @@ describe Projects::BranchesController do namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(303) + expect(response).to have_gitlab_http_status(303) end end @@ -226,28 +226,28 @@ describe Projects::BranchesController do context "valid branch name, valid source" do let(:branch) { "feature" } - it { expect(response).to have_http_status(200) } + it { expect(response).to have_gitlab_http_status(200) } it { expect(response.body).to be_blank } end context "valid branch name with unencoded slashes" do let(:branch) { "improve/awesome" } - it { expect(response).to have_http_status(200) } + it { expect(response).to have_gitlab_http_status(200) } it { expect(response.body).to be_blank } end context "valid branch name with encoded slashes" do let(:branch) { "improve%2Fawesome" } - it { expect(response).to have_http_status(200) } + it { expect(response).to have_gitlab_http_status(200) } it { expect(response.body).to be_blank } end context "invalid branch name, valid ref" do let(:branch) { "no-branch" } - it { expect(response).to have_http_status(404) } + it { expect(response).to have_gitlab_http_status(404) } it { expect(response.body).to be_blank } end end @@ -263,7 +263,7 @@ describe Projects::BranchesController do expect(json_response).to eql("message" => 'Branch was removed') end - it { expect(response).to have_http_status(200) } + it { expect(response).to have_gitlab_http_status(200) } end context 'valid branch name with unencoded slashes' do @@ -273,7 +273,7 @@ describe Projects::BranchesController do expect(json_response).to eql('message' => 'Branch was removed') end - it { expect(response).to have_http_status(200) } + it { expect(response).to have_gitlab_http_status(200) } end context "valid branch name with encoded slashes" do @@ -283,7 +283,7 @@ describe Projects::BranchesController do expect(json_response).to eql('message' => 'Branch was removed') end - it { expect(response).to have_http_status(200) } + it { expect(response).to have_gitlab_http_status(200) } end context 'invalid branch name, valid ref' do @@ -293,7 +293,7 @@ describe Projects::BranchesController do expect(json_response).to eql('message' => 'No such branch') end - it { expect(response).to have_http_status(404) } + it { expect(response).to have_gitlab_http_status(404) } end end @@ -341,7 +341,7 @@ describe Projects::BranchesController do it 'responds with status 404' do destroy_all_merged - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -379,7 +379,7 @@ describe Projects::BranchesController do project_id: project, format: :html - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end diff --git a/spec/controllers/projects/clusters_controller_spec.rb b/spec/controllers/projects/clusters_controller_spec.rb index 7985028d73b..bd924a1c7be 100644 --- a/spec/controllers/projects/clusters_controller_spec.rb +++ b/spec/controllers/projects/clusters_controller_spec.rb @@ -169,7 +169,7 @@ describe Projects::ClustersController do it "responds with matching schema" do subject - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('cluster_status') end end @@ -189,14 +189,14 @@ describe Projects::ClustersController do it "allows to update cluster" do subject - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response.body).to include("Save") end it "allows remove integration" do subject - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response.body).to include("Remove integration") end end @@ -207,7 +207,7 @@ describe Projects::ClustersController do it "does not allow to access page" do subject - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -251,7 +251,7 @@ describe Projects::ClustersController do it "rejects changes" do subject - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to render_template(:show) end end @@ -263,7 +263,7 @@ describe Projects::ClustersController do it "does not allow to update cluster" do subject - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -292,7 +292,7 @@ describe Projects::ClustersController do it "does not allow to destroy cluster" do subject - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end end diff --git a/spec/controllers/projects/commit_controller_spec.rb b/spec/controllers/projects/commit_controller_spec.rb index df53863482d..4612fc6e441 100644 --- a/spec/controllers/projects/commit_controller_spec.rb +++ b/spec/controllers/projects/commit_controller_spec.rb @@ -157,7 +157,7 @@ describe Projects::CommitController do id: commit.id) expect(response).not_to be_success - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -206,7 +206,7 @@ describe Projects::CommitController do id: master_pickable_commit.id) expect(response).not_to be_success - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -286,7 +286,7 @@ describe Projects::CommitController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -298,7 +298,7 @@ describe Projects::CommitController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -309,7 +309,7 @@ describe Projects::CommitController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -356,7 +356,7 @@ describe Projects::CommitController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/compare_controller_spec.rb b/spec/controllers/projects/compare_controller_spec.rb index b4f9fd9b7a2..fe5818da0bc 100644 --- a/spec/controllers/projects/compare_controller_spec.rb +++ b/spec/controllers/projects/compare_controller_spec.rb @@ -133,7 +133,7 @@ describe Projects::CompareController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -145,7 +145,7 @@ describe Projects::CompareController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -156,7 +156,7 @@ describe Projects::CompareController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -166,7 +166,7 @@ describe Projects::CompareController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/deployments_controller_spec.rb b/spec/controllers/projects/deployments_controller_spec.rb index 3daff1eeea3..3164fd5c143 100644 --- a/spec/controllers/projects/deployments_controller_spec.rb +++ b/spec/controllers/projects/deployments_controller_spec.rb @@ -67,7 +67,7 @@ describe Projects::DeploymentsController do it 'returns a empty response 204 resposne' do get :metrics, deployment_params(id: deployment.id) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) expect(response.body).to eq('') end end @@ -142,7 +142,7 @@ describe Projects::DeploymentsController do it 'returns a empty response 204 response' do get :additional_metrics, deployment_params(id: deployment.id, format: :json) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) expect(response.body).to eq('') end end diff --git a/spec/controllers/projects/discussions_controller_spec.rb b/spec/controllers/projects/discussions_controller_spec.rb index fe62898fa9b..3bf676637a2 100644 --- a/spec/controllers/projects/discussions_controller_spec.rb +++ b/spec/controllers/projects/discussions_controller_spec.rb @@ -25,7 +25,7 @@ describe Projects::DiscussionsController do it "returns status 404" do post :resolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -42,7 +42,7 @@ describe Projects::DiscussionsController do it "returns status 404" do post :resolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -69,7 +69,7 @@ describe Projects::DiscussionsController do it "returns status 200" do post :resolve, request_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end @@ -86,7 +86,7 @@ describe Projects::DiscussionsController do it "returns status 404" do delete :unresolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -103,7 +103,7 @@ describe Projects::DiscussionsController do it "returns status 404" do delete :unresolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -117,7 +117,7 @@ describe Projects::DiscussionsController do it "returns status 200" do delete :unresolve, request_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end diff --git a/spec/controllers/projects/environments_controller_spec.rb b/spec/controllers/projects/environments_controller_spec.rb index 5a95f4f6199..ff9ab53d8c3 100644 --- a/spec/controllers/projects/environments_controller_spec.rb +++ b/spec/controllers/projects/environments_controller_spec.rb @@ -19,7 +19,7 @@ describe Projects::EnvironmentsController do it 'responds with status code 200' do get :index, environment_params - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end end @@ -59,7 +59,7 @@ describe Projects::EnvironmentsController do end it 'sets the polling interval header' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response.headers['Poll-Interval']).to eq("3000") end end @@ -137,7 +137,7 @@ describe Projects::EnvironmentsController do params[:id] = 12345 get :show, params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -155,7 +155,7 @@ describe Projects::EnvironmentsController do patch_params = environment_params.merge(environment: { external_url: 'https://git.gitlab.com' }) patch :update, patch_params - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -166,7 +166,7 @@ describe Projects::EnvironmentsController do patch :stop, environment_params(format: :json) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -179,7 +179,7 @@ describe Projects::EnvironmentsController do patch :stop, environment_params(format: :json) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response).to eq( { 'redirect_url' => project_job_url(project, action) }) @@ -193,7 +193,7 @@ describe Projects::EnvironmentsController do patch :stop, environment_params(format: :json) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response).to eq( { 'redirect_url' => project_environment_url(project, environment) }) @@ -206,7 +206,7 @@ describe Projects::EnvironmentsController do it 'responds with a status code 200' do get :terminal, environment_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'loads the terminals for the enviroment' do @@ -220,7 +220,7 @@ describe Projects::EnvironmentsController do it 'responds with a status code 404' do get :terminal, environment_params(id: 666) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -244,7 +244,7 @@ describe Projects::EnvironmentsController do get :terminal_websocket_authorize, environment_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.headers["Content-Type"]).to eq(Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE) expect(response.body).to eq('{"workhorse":"response"}') end @@ -254,7 +254,7 @@ describe Projects::EnvironmentsController do it 'returns 404' do get :terminal_websocket_authorize, environment_params(id: 666) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -290,7 +290,7 @@ describe Projects::EnvironmentsController do it 'returns a metrics JSON document' do get :metrics, environment_params(format: :json) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) expect(json_response).to eq({}) end end @@ -330,7 +330,7 @@ describe Projects::EnvironmentsController do it 'returns a metrics JSON document' do get :additional_metrics, environment_params(format: :json) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) expect(json_response).to eq({}) end end diff --git a/spec/controllers/projects/forks_controller_spec.rb b/spec/controllers/projects/forks_controller_spec.rb index dc8290c438e..1bedb8ebdff 100644 --- a/spec/controllers/projects/forks_controller_spec.rb +++ b/spec/controllers/projects/forks_controller_spec.rb @@ -89,7 +89,7 @@ describe Projects::ForksController do get_new - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -118,7 +118,7 @@ describe Projects::ForksController do post_create - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(response).to redirect_to(namespace_project_import_path(user.namespace, project)) end end diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index ed8088a46f0..6f48f091a20 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -20,7 +20,7 @@ describe Projects::IssuesController do get :index, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -28,7 +28,7 @@ describe Projects::IssuesController do it 'renders the "index" template' do get :index, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template(:index) end end @@ -45,7 +45,7 @@ describe Projects::IssuesController do it "returns index" do get :index, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it "returns 301 if request path doesn't match project path" do @@ -59,7 +59,7 @@ describe Projects::IssuesController do project.save! get :index, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -89,7 +89,7 @@ describe Projects::IssuesController do page: last_page.to_param expect(assigns(:issues).current_page).to eq(last_page) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'does not redirect to external sites when provided a host field' do @@ -166,7 +166,7 @@ describe Projects::IssuesController do get :new, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -174,7 +174,7 @@ describe Projects::IssuesController do it 'renders the "new" template' do get :new, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template(:new) end end @@ -224,7 +224,7 @@ describe Projects::IssuesController do it 'moves issue to another project' do move_issue - expect(response).to have_http_status :ok + expect(response).to have_gitlab_http_status :ok expect(another_project.issues).not_to be_empty end end @@ -233,7 +233,7 @@ describe Projects::IssuesController do it 'responds with 404' do move_issue - expect(response).to have_http_status :not_found + expect(response).to have_gitlab_http_status :not_found end end @@ -329,14 +329,14 @@ describe Projects::IssuesController do sign_out(:user) go(id: unescaped_parameter_value.to_param) - expect(response).to have_http_status :not_found + expect(response).to have_gitlab_http_status :not_found end it 'returns 404 for non project members' do sign_in(non_member) go(id: unescaped_parameter_value.to_param) - expect(response).to have_http_status :not_found + expect(response).to have_gitlab_http_status :not_found end it 'returns 404 for project members with guest role' do @@ -344,21 +344,21 @@ describe Projects::IssuesController do project.team << [member, :guest] go(id: unescaped_parameter_value.to_param) - expect(response).to have_http_status :not_found + expect(response).to have_gitlab_http_status :not_found end it "returns #{http_status[:success]} for author" do sign_in(author) go(id: unescaped_parameter_value.to_param) - expect(response).to have_http_status http_status[:success] + expect(response).to have_gitlab_http_status http_status[:success] end it "returns #{http_status[:success]} for assignee" do sign_in(assignee) go(id: request_forgery_timing_attack.to_param) - expect(response).to have_http_status http_status[:success] + expect(response).to have_gitlab_http_status http_status[:success] end it "returns #{http_status[:success]} for project members" do @@ -366,14 +366,14 @@ describe Projects::IssuesController do project.team << [member, :developer] go(id: unescaped_parameter_value.to_param) - expect(response).to have_http_status http_status[:success] + expect(response).to have_gitlab_http_status http_status[:success] end it "returns #{http_status[:success]} for admin" do sign_in(admin) go(id: unescaped_parameter_value.to_param) - expect(response).to have_http_status http_status[:success] + expect(response).to have_gitlab_http_status http_status[:success] end end @@ -475,7 +475,7 @@ describe Projects::IssuesController do it 'returns 422 status' do update_issue - expect(response).to have_http_status(422) + expect(response).to have_gitlab_http_status(422) end end @@ -495,7 +495,7 @@ describe Projects::IssuesController do end it 'returns 200 status' do - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'accepts an issue after recaptcha is verified' do @@ -553,7 +553,7 @@ describe Projects::IssuesController do it 'returns 200' do go(id: issue.iid) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end @@ -778,7 +778,7 @@ describe Projects::IssuesController do it "rejects a developer to destroy an issue" do delete :destroy, namespace_id: project.namespace, project_id: project, id: issue.iid - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -794,7 +794,7 @@ describe Projects::IssuesController do it "deletes the issue" do delete :destroy, namespace_id: project.namespace, project_id: project, id: issue.iid - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(controller).to set_flash[:notice].to(/The issue was successfully deleted\./) end @@ -818,7 +818,7 @@ describe Projects::IssuesController do project_id: project, id: issue.iid, name: "thumbsup") end.to change { issue.award_emoji.count }.by(1) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end diff --git a/spec/controllers/projects/jobs_controller_spec.rb b/spec/controllers/projects/jobs_controller_spec.rb index d01339a0b88..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,7 +212,7 @@ 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 @@ -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 diff --git a/spec/controllers/projects/labels_controller_spec.rb b/spec/controllers/projects/labels_controller_spec.rb index f4e2dca883d..cf83f2f3265 100644 --- a/spec/controllers/projects/labels_controller_spec.rb +++ b/spec/controllers/projects/labels_controller_spec.rb @@ -78,7 +78,7 @@ describe Projects::LabelsController do it 'creates labels' do post :generate, namespace_id: personal_project.namespace.to_param, project_id: personal_project - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -86,7 +86,7 @@ describe Projects::LabelsController do it 'creates labels' do post :generate, namespace_id: project.namespace.to_param, project_id: project - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end end @@ -97,7 +97,7 @@ describe Projects::LabelsController do toggle_subscription(label) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'allows user to toggle subscription on group labels' do @@ -105,7 +105,7 @@ describe Projects::LabelsController do toggle_subscription(group_label) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end def toggle_subscription(label) @@ -121,7 +121,7 @@ describe Projects::LabelsController do it 'denies access' do post :promote, namespace_id: project.namespace.to_param, project_id: project, id: label_1.to_param - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -170,7 +170,7 @@ describe Projects::LabelsController do it 'does not redirect' do get :index, namespace_id: project.namespace, project_id: project.to_param - expect(response).not_to have_http_status(301) + expect(response).not_to have_gitlab_http_status(301) end end @@ -203,13 +203,13 @@ describe Projects::LabelsController do it 'does not 404' do post :generate, namespace_id: project.namespace, project_id: project - expect(response).not_to have_http_status(404) + expect(response).not_to have_gitlab_http_status(404) end it 'does not redirect to the correct casing' do post :generate, namespace_id: project.namespace, project_id: project - expect(response).not_to have_http_status(301) + expect(response).not_to have_gitlab_http_status(301) end end @@ -219,7 +219,7 @@ describe Projects::LabelsController do it 'returns not found' do post :generate, namespace_id: project.namespace, project_id: project.to_param + 'old' - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/mattermosts_controller_spec.rb b/spec/controllers/projects/mattermosts_controller_spec.rb index 4eea7041d29..33d48ff94d1 100644 --- a/spec/controllers/projects/mattermosts_controller_spec.rb +++ b/spec/controllers/projects/mattermosts_controller_spec.rb @@ -20,7 +20,7 @@ describe Projects::MattermostsController do namespace_id: project.namespace.to_param, project_id: project) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end diff --git a/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb b/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb index c6d50c28106..2d7647a6e12 100644 --- a/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/conflicts_controller_spec.rb @@ -28,7 +28,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 200 status code' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end it 'returns JSON with a message' do @@ -116,7 +116,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 404 status code' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -126,7 +126,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 404 status code' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -138,7 +138,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 200 status code' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end it 'returns the file in JSON format' do @@ -198,7 +198,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns an OK response' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end end @@ -224,7 +224,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 400 error' do - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) end it 'has a message with the name of the first missing section' do @@ -254,7 +254,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 400 error' do - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) end it 'has a message with the name of the missing file' do @@ -292,7 +292,7 @@ describe Projects::MergeRequests::ConflictsController do end it 'returns a 400 error' do - expect(response).to have_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:bad_request) end it 'has a message with the path of the problem file' do diff --git a/spec/controllers/projects/merge_requests/creations_controller_spec.rb b/spec/controllers/projects/merge_requests/creations_controller_spec.rb index fc4cec53374..7fdddc02fd3 100644 --- a/spec/controllers/projects/merge_requests/creations_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/creations_controller_spec.rb @@ -112,7 +112,7 @@ describe Projects::MergeRequests::CreationsController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb index 7260350d5fb..18a70bec103 100644 --- a/spec/controllers/projects/merge_requests/diffs_controller_spec.rb +++ b/spec/controllers/projects/merge_requests/diffs_controller_spec.rb @@ -119,7 +119,7 @@ describe Projects::MergeRequests::DiffsController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -131,7 +131,7 @@ describe Projects::MergeRequests::DiffsController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -142,7 +142,7 @@ describe Projects::MergeRequests::DiffsController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -155,7 +155,7 @@ describe Projects::MergeRequests::DiffsController do end it 'returns a 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 707e7c32283..b7cccddefdd 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -143,7 +143,7 @@ describe Projects::MergeRequestsController do get_merge_requests(last_page) expect(assigns(:merge_requests).current_page).to eq(last_page) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'does not redirect to external sites when provided a host field' do @@ -278,7 +278,7 @@ describe Projects::MergeRequestsController do end it 'returns 404' do - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -434,7 +434,7 @@ describe Projects::MergeRequestsController do it "denies access to users unless they're admin or project owner" do delete :destroy, namespace_id: project.namespace, project_id: project, id: merge_request.iid - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end context "when the user is owner" do @@ -449,7 +449,7 @@ describe Projects::MergeRequestsController do it "deletes the merge request" do delete :destroy, namespace_id: project.namespace, project_id: project, id: merge_request.iid - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(controller).to set_flash[:notice].to(/The merge request was successfully deleted\./) end @@ -539,7 +539,7 @@ describe Projects::MergeRequestsController do subject end - it { is_expected.to have_http_status(:success) } + it { is_expected.to have_gitlab_http_status(:success) } it 'renders MergeRequest as JSON' do subject @@ -636,7 +636,7 @@ describe Projects::MergeRequestsController do end it 'return a detailed head_pipeline 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 @@ -650,7 +650,7 @@ describe Projects::MergeRequestsController do end it 'return empty' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_empty end end diff --git a/spec/controllers/projects/milestones_controller_spec.rb b/spec/controllers/projects/milestones_controller_spec.rb index 62f1fb1f697..573530d0db0 100644 --- a/spec/controllers/projects/milestones_controller_spec.rb +++ b/spec/controllers/projects/milestones_controller_spec.rb @@ -27,7 +27,7 @@ describe Projects::MilestonesController do it 'shows milestone page' do view_milestone - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end diff --git a/spec/controllers/projects/notes_controller_spec.rb b/spec/controllers/projects/notes_controller_spec.rb index 135fd6449ff..1184c55e540 100644 --- a/spec/controllers/projects/notes_controller_spec.rb +++ b/spec/controllers/projects/notes_controller_spec.rb @@ -180,13 +180,13 @@ describe Projects::NotesController do it "returns status 302 for html" do post :create, request_params - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end it "returns status 200 for json" do post :create, request_params.merge(format: :json) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end context 'when merge_request_diff_head_sha present' do @@ -205,7 +205,7 @@ describe Projects::NotesController do it "returns status 302 for html" do post :create, request_params - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -240,7 +240,7 @@ describe Projects::NotesController do it 'returns a 404' do post_create(note_project_id: Project.maximum(:id).succ) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -248,7 +248,7 @@ describe Projects::NotesController do it 'returns a 404' do post_create - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -278,7 +278,7 @@ describe Projects::NotesController do request_params[:note][:noteable_id] = 9999 post :create, request_params.merge(format: :json) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -286,13 +286,13 @@ describe Projects::NotesController do it 'returns 302 status for html' do post :create, request_params - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end it 'returns 200 status for json' do post :create, request_params.merge(format: :json) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'creates a new note' do @@ -308,7 +308,7 @@ describe Projects::NotesController do it 'returns 404 status' do post :create, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end it 'does not create a new note' do @@ -337,7 +337,7 @@ describe Projects::NotesController do it "returns status 200 for html" do delete :destroy, request_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it "deletes the note" do @@ -354,7 +354,7 @@ describe Projects::NotesController do it "returns status 404" do delete :destroy, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -370,7 +370,7 @@ describe Projects::NotesController do post(:toggle_award_emoji, request_params.merge(name: "thumbsup")) end.to change { note.award_emoji.count }.by(1) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it "removes the already awarded emoji" do @@ -380,7 +380,7 @@ describe Projects::NotesController do post(:toggle_award_emoji, request_params.merge(name: "thumbsup")) end.to change { AwardEmoji.count }.by(-1) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -398,7 +398,7 @@ describe Projects::NotesController do it "returns status 404" do post :resolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -415,7 +415,7 @@ describe Projects::NotesController do it "returns status 404" do post :resolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -442,7 +442,7 @@ describe Projects::NotesController do it "returns status 200" do post :resolve, request_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end @@ -459,7 +459,7 @@ describe Projects::NotesController do it "returns status 404" do delete :unresolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -476,7 +476,7 @@ describe Projects::NotesController do it "returns status 404" do delete :unresolve, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -490,7 +490,7 @@ describe Projects::NotesController do it "returns status 200" do delete :unresolve, request_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end diff --git a/spec/controllers/projects/pages_controller_spec.rb b/spec/controllers/projects/pages_controller_spec.rb index 83c7744a231..4705c50de7e 100644 --- a/spec/controllers/projects/pages_controller_spec.rb +++ b/spec/controllers/projects/pages_controller_spec.rb @@ -21,7 +21,7 @@ describe Projects::PagesController do it 'returns 200 status' do get :show, request_params - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end context 'when the project is in a subgroup' do @@ -31,7 +31,7 @@ describe Projects::PagesController do it 'returns a 404 status code' do get :show, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -40,7 +40,7 @@ describe Projects::PagesController do it 'returns 302 status' do delete :destroy, request_params - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -53,7 +53,7 @@ describe Projects::PagesController do it 'returns 404 status' do get :show, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -61,7 +61,7 @@ describe Projects::PagesController do it 'returns 404 status' do delete :destroy, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/pages_domains_controller_spec.rb b/spec/controllers/projects/pages_domains_controller_spec.rb index ad4d7da3bdd..e9e7d357d9c 100644 --- a/spec/controllers/projects/pages_domains_controller_spec.rb +++ b/spec/controllers/projects/pages_domains_controller_spec.rb @@ -26,7 +26,7 @@ describe Projects::PagesDomainsController do it "displays the 'show' page" do get(:show, request_params.merge(id: pages_domain.domain)) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template('show') end end @@ -35,7 +35,7 @@ describe Projects::PagesDomainsController do it "displays the 'new' page" do get(:new, request_params) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template('new') end end @@ -69,7 +69,7 @@ describe Projects::PagesDomainsController do it 'returns 404 status' do get(:show, request_params.merge(id: pages_domain.domain)) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -77,7 +77,7 @@ describe Projects::PagesDomainsController do it 'returns 404 status' do get :new, request_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -85,7 +85,7 @@ describe Projects::PagesDomainsController do it "returns 404 status" do post(:create, request_params.merge(pages_domain: pages_domain_params)) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -93,7 +93,7 @@ describe Projects::PagesDomainsController do it "deletes the pages domain" do delete(:destroy, request_params.merge(id: pages_domain.domain)) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/pipeline_schedules_controller_spec.rb b/spec/controllers/projects/pipeline_schedules_controller_spec.rb index 4ac0559c679..4e52e261920 100644 --- a/spec/controllers/projects/pipeline_schedules_controller_spec.rb +++ b/spec/controllers/projects/pipeline_schedules_controller_spec.rb @@ -15,7 +15,7 @@ describe Projects::PipelineSchedulesController do it 'renders the index view' do visit_pipelines_schedules - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to render_template(:index) end @@ -35,7 +35,7 @@ describe Projects::PipelineSchedulesController do end it 'only shows active pipeline schedules' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:schedules)).to include(pipeline_schedule) expect(assigns(:schedules)).not_to include(inactive_pipeline_schedule) end @@ -57,7 +57,7 @@ describe Projects::PipelineSchedulesController do it 'initializes a pipeline schedule model' do get :new, namespace_id: project.namespace.to_param, project_id: project - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:schedule)).to be_a_new(Ci::PipelineSchedule) end end @@ -87,7 +87,7 @@ describe Projects::PipelineSchedulesController do .to change { Ci::PipelineSchedule.count }.by(1) .and change { Ci::PipelineScheduleVariable.count }.by(1) - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) Ci::PipelineScheduleVariable.last.tap do |v| expect(v.key).to eq("AAA") @@ -158,7 +158,7 @@ describe Projects::PipelineSchedulesController do expect { go }.to change { Ci::PipelineScheduleVariable.count }.by(1) pipeline_schedule.reload - expect(response).to have_http_status(:found) + expect(response).to have_gitlab_http_status(:found) expect(pipeline_schedule.variables.last.key).to eq('AAA') expect(pipeline_schedule.variables.last.value).to eq('AAA123') end @@ -324,7 +324,7 @@ describe Projects::PipelineSchedulesController do it 'loads the pipeline schedule' do get :edit, namespace_id: project.namespace.to_param, project_id: project, id: pipeline_schedule.id - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(assigns(:schedule)).to eq(pipeline_schedule) end end @@ -376,7 +376,7 @@ describe Projects::PipelineSchedulesController do end it 'does not delete the pipeline schedule' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -391,7 +391,7 @@ describe Projects::PipelineSchedulesController do delete :destroy, namespace_id: project.namespace.to_param, project_id: project, id: pipeline_schedule.id end.to change { project.pipeline_schedules.count }.by(-1) - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end end diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index 67b53d2acce..f1ad5dd84ff 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -33,7 +33,7 @@ describe Projects::PipelinesController do it 'returns JSON with serialized pipelines' do subject - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('pipeline') expect(json_response).to include('pipelines') @@ -57,7 +57,7 @@ describe Projects::PipelinesController do it 'returns the pipeline' do get_pipeline_json - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).not_to be_an(Array) expect(json_response['id']).to be(pipeline.id) expect(json_response['details']).to have_key 'stages' @@ -111,7 +111,7 @@ describe Projects::PipelinesController do end it 'returns html source for stage dropdown' do - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to render_template('projects/pipelines/_stage') expect(json_response).to include('html') end @@ -123,7 +123,7 @@ describe Projects::PipelinesController do end it 'responds with not found' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end @@ -148,7 +148,7 @@ describe Projects::PipelinesController do end it 'return a detailed pipeline 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 @@ -171,14 +171,14 @@ describe Projects::PipelinesController do let(:feature) { ProjectFeature::ENABLED } it 'retries a pipeline without returning any content' do - expect(response).to have_http_status(:no_content) + expect(response).to have_gitlab_http_status(:no_content) expect(build.reload).to be_retried end end context 'when builds are disabled' do it 'fails to retry pipeline' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end end @@ -198,14 +198,14 @@ describe Projects::PipelinesController do let(:feature) { ProjectFeature::ENABLED } it 'cancels a pipeline without returning any content' do - expect(response).to have_http_status(:no_content) + expect(response).to have_gitlab_http_status(:no_content) expect(pipeline.reload).to be_canceled end end context 'when builds are disabled' do it 'fails to retry pipeline' do - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end end diff --git a/spec/controllers/projects/pipelines_settings_controller_spec.rb b/spec/controllers/projects/pipelines_settings_controller_spec.rb index ee46ad00947..21b6a6d45f5 100644 --- a/spec/controllers/projects/pipelines_settings_controller_spec.rb +++ b/spec/controllers/projects/pipelines_settings_controller_spec.rb @@ -25,7 +25,7 @@ describe Projects::PipelinesSettingsController do let(:params) { { enabled: '', domain: 'mepmep.md' } } it 'redirects to the settings page' do - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(flash[:notice]).to eq("Pipelines settings for '#{project.name}' were successfully updated.") end diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb index 3cb1bec5ea2..a34dc27a5ed 100644 --- a/spec/controllers/projects/project_members_controller_spec.rb +++ b/spec/controllers/projects/project_members_controller_spec.rb @@ -8,7 +8,7 @@ describe Projects::ProjectMembersController do it 'should have the project_members address with a 200 status code' do get :index, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -30,7 +30,7 @@ describe Projects::ProjectMembersController do user_ids: project_user.id, access_level: Gitlab::Access::GUEST - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) expect(project.users).not_to include project_user end end @@ -79,7 +79,7 @@ describe Projects::ProjectMembersController do project_id: project, id: 42 - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -94,7 +94,7 @@ describe Projects::ProjectMembersController do project_id: project, id: member - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) expect(project.members).to include member end end @@ -137,7 +137,7 @@ describe Projects::ProjectMembersController do delete :leave, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -168,7 +168,7 @@ describe Projects::ProjectMembersController do delete :leave, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(403) + expect(response).to have_gitlab_http_status(403) end end @@ -221,7 +221,7 @@ describe Projects::ProjectMembersController do project_id: project, id: 42 - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -236,7 +236,7 @@ describe Projects::ProjectMembersController do project_id: project, id: member - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) expect(project.members).not_to include member end end diff --git a/spec/controllers/projects/prometheus_controller_spec.rb b/spec/controllers/projects/prometheus_controller_spec.rb index 8407a53272a..bbfe78d305a 100644 --- a/spec/controllers/projects/prometheus_controller_spec.rb +++ b/spec/controllers/projects/prometheus_controller_spec.rb @@ -24,7 +24,7 @@ describe Projects::PrometheusController do it 'returns no content response' do get :active_metrics, project_params(format: :json) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) end end @@ -38,7 +38,7 @@ describe Projects::PrometheusController do it 'returns no content response' do get :active_metrics, project_params(format: :json) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response).to eq(sample_response.deep_stringify_keys) end end @@ -47,7 +47,7 @@ describe Projects::PrometheusController do it 'returns not found response' do get :active_metrics, project_params - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/raw_controller_spec.rb b/spec/controllers/projects/raw_controller_spec.rb index b4eaab29fed..3a0c3faa7b4 100644 --- a/spec/controllers/projects/raw_controller_spec.rb +++ b/spec/controllers/projects/raw_controller_spec.rb @@ -13,7 +13,7 @@ describe Projects::RawController do project_id: public_project, id: id) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.header['Content-Type']).to eq('text/plain; charset=utf-8') expect(response.header['Content-Disposition']) .to eq('inline') @@ -30,7 +30,7 @@ describe Projects::RawController do project_id: public_project, id: id) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.header['Content-Type']).to eq('image/jpeg') expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with('git-blob:') end @@ -59,7 +59,7 @@ describe Projects::RawController do project_id: public_project, id: id) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -70,7 +70,7 @@ describe Projects::RawController do project_id: public_project, id: id) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -86,7 +86,7 @@ describe Projects::RawController do project_id: public_project, id: id) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response.header['Content-Type']).to eq('text/plain; charset=utf-8') expect(response.header['Content-Disposition']) .to eq('inline') diff --git a/spec/controllers/projects/registry/repositories_controller_spec.rb b/spec/controllers/projects/registry/repositories_controller_spec.rb index 5d9d5351687..17769a14def 100644 --- a/spec/controllers/projects/registry/repositories_controller_spec.rb +++ b/spec/controllers/projects/registry/repositories_controller_spec.rb @@ -35,7 +35,7 @@ describe Projects::Registry::RepositoriesController do it 'successfully renders container repositories' do go_to_index - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end it 'creates a root container repository' do @@ -46,7 +46,7 @@ describe Projects::Registry::RepositoriesController do it 'json has a list of projects' do go_to_index(format: :json) - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('registry/repositories') end end @@ -59,7 +59,7 @@ describe Projects::Registry::RepositoriesController do it 'successfully renders container repositories' do go_to_index - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) end it 'does not ensure root container repository' do @@ -69,7 +69,7 @@ describe Projects::Registry::RepositoriesController do it 'responds with json if asked' do go_to_index(format: :json) - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_kind_of(Array) end end @@ -89,7 +89,7 @@ describe Projects::Registry::RepositoriesController do it 'deletes a repository' do expect { delete_repository(repository) }.to change { ContainerRepository.all.count }.by(-1) - expect(response).to have_http_status(:no_content) + expect(response).to have_gitlab_http_status(:no_content) end end end @@ -100,7 +100,7 @@ describe Projects::Registry::RepositoriesController do it 'responds with 404' do go_to_index - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end it 'does not ensure root container repository' do diff --git a/spec/controllers/projects/registry/tags_controller_spec.rb b/spec/controllers/projects/registry/tags_controller_spec.rb index bb702ebeb23..7fee8fd44ff 100644 --- a/spec/controllers/projects/registry/tags_controller_spec.rb +++ b/spec/controllers/projects/registry/tags_controller_spec.rb @@ -30,7 +30,7 @@ describe Projects::Registry::TagsController do it 'receive a list of tags' do get_tags - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('registry/tags') expect(response).to include_pagination_headers end @@ -44,7 +44,7 @@ describe Projects::Registry::TagsController do it 'receive a list of tags' do get_tags - expect(response).to have_http_status(:ok) + expect(response).to have_gitlab_http_status(:ok) expect(response).to match_response_schema('registry/tags') expect(response).to include_pagination_headers end @@ -58,7 +58,7 @@ describe Projects::Registry::TagsController do it 'does not receive a list of tags' do get_tags - expect(response).to have_http_status(:not_found) + expect(response).to have_gitlab_http_status(:not_found) end end diff --git a/spec/controllers/projects/repositories_controller_spec.rb b/spec/controllers/projects/repositories_controller_spec.rb index f712d1e0d63..8b777eb68ca 100644 --- a/spec/controllers/projects/repositories_controller_spec.rb +++ b/spec/controllers/projects/repositories_controller_spec.rb @@ -35,7 +35,7 @@ describe Projects::RepositoriesController do it "renders Not Found" do get :archive, namespace_id: project.namespace, project_id: project, ref: "master", format: "zip" - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/runners_controller_spec.rb b/spec/controllers/projects/runners_controller_spec.rb index 2b6f988fd9c..89a13f3c976 100644 --- a/spec/controllers/projects/runners_controller_spec.rb +++ b/spec/controllers/projects/runners_controller_spec.rb @@ -29,7 +29,7 @@ describe Projects::RunnersController do runner.reload - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(runner.description).to eq(new_desc) end end @@ -38,7 +38,7 @@ describe Projects::RunnersController do it 'destroys the runner' do delete :destroy, params - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(Ci::Runner.find_by(id: runner.id)).to be_nil end end @@ -53,7 +53,7 @@ describe Projects::RunnersController do runner.reload - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(runner.active).to eq(true) end end @@ -68,7 +68,7 @@ describe Projects::RunnersController do runner.reload - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) expect(runner.active).to eq(false) end end diff --git a/spec/controllers/projects/services_controller_spec.rb b/spec/controllers/projects/services_controller_spec.rb index efba9cc7306..a907da2b60f 100644 --- a/spec/controllers/projects/services_controller_spec.rb +++ b/spec/controllers/projects/services_controller_spec.rb @@ -19,7 +19,7 @@ describe Projects::ServicesController do put :test, namespace_id: project.namespace, project_id: project, id: service.to_param - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end diff --git a/spec/controllers/projects/settings/ci_cd_controller_spec.rb b/spec/controllers/projects/settings/ci_cd_controller_spec.rb index a8f4b79b64c..b8fe0f46f57 100644 --- a/spec/controllers/projects/settings/ci_cd_controller_spec.rb +++ b/spec/controllers/projects/settings/ci_cd_controller_spec.rb @@ -13,7 +13,7 @@ describe Projects::Settings::CiCdController do it 'renders show with 200 status code' do get :show, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template(:show) end end diff --git a/spec/controllers/projects/settings/integrations_controller_spec.rb b/spec/controllers/projects/settings/integrations_controller_spec.rb index e0f9a5b24a6..3068837f394 100644 --- a/spec/controllers/projects/settings/integrations_controller_spec.rb +++ b/spec/controllers/projects/settings/integrations_controller_spec.rb @@ -13,7 +13,7 @@ describe Projects::Settings::IntegrationsController do it 'renders show with 200 status code' do get :show, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template(:show) end end diff --git a/spec/controllers/projects/settings/repository_controller_spec.rb b/spec/controllers/projects/settings/repository_controller_spec.rb index f73471f8ca8..3a4014b7768 100644 --- a/spec/controllers/projects/settings/repository_controller_spec.rb +++ b/spec/controllers/projects/settings/repository_controller_spec.rb @@ -13,7 +13,7 @@ describe Projects::Settings::RepositoryController do it 'renders show with 200 status code' do get :show, namespace_id: project.namespace, project_id: project - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template(:show) end end diff --git a/spec/controllers/projects/snippets_controller_spec.rb b/spec/controllers/projects/snippets_controller_spec.rb index 3a1550aa730..e7c0b484ede 100644 --- a/spec/controllers/projects/snippets_controller_spec.rb +++ b/spec/controllers/projects/snippets_controller_spec.rb @@ -29,7 +29,7 @@ describe Projects::SnippetsController do project_id: project, page: last_page.to_param expect(assigns(:snippets).current_page).to eq(last_page) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -41,7 +41,7 @@ describe Projects::SnippetsController do get :index, namespace_id: project.namespace, project_id: project expect(assigns(:snippets)).not_to include(project_snippet) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -54,7 +54,7 @@ describe Projects::SnippetsController do get :index, namespace_id: project.namespace, project_id: project expect(assigns(:snippets)).to include(project_snippet) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -67,7 +67,7 @@ describe Projects::SnippetsController do get :index, namespace_id: project.namespace, project_id: project expect(assigns(:snippets)).to include(project_snippet) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end @@ -316,7 +316,7 @@ describe Projects::SnippetsController do it 'responds with status 404' do get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -329,7 +329,7 @@ describe Projects::SnippetsController do get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param expect(assigns(:snippet)).to eq(project_snippet) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -342,7 +342,7 @@ describe Projects::SnippetsController do get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param expect(assigns(:snippet)).to eq(project_snippet) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end end @@ -352,7 +352,7 @@ describe Projects::SnippetsController do it 'responds with status 404' do get action, namespace_id: project.namespace, project_id: project, id: 42 - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -364,7 +364,7 @@ describe Projects::SnippetsController do it 'responds with status 404' do get action, namespace_id: project.namespace, project_id: project, id: 42 - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/todos_controller_spec.rb b/spec/controllers/projects/todos_controller_spec.rb index 41d211ed1bb..4622e27e60f 100644 --- a/spec/controllers/projects/todos_controller_spec.rb +++ b/spec/controllers/projects/todos_controller_spec.rb @@ -28,13 +28,13 @@ describe Projects::TodosController do go end.to change { user.todos.count }.by(1) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'returns todo path and pending count' do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response['count']).to eq 1 expect(json_response['delete_path']).to match(/\/dashboard\/todos\/\d{1}/) end @@ -47,7 +47,7 @@ describe Projects::TodosController do go end.to change { user.todos.count }.by(0) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end it 'does not create todo for issue when user not logged in' do @@ -55,7 +55,7 @@ describe Projects::TodosController do go end.to change { user.todos.count }.by(0) - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -68,7 +68,7 @@ describe Projects::TodosController do it "doesn't create todo" do expect { go }.not_to change { user.todos.count } - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -96,13 +96,13 @@ describe Projects::TodosController do go end.to change { user.todos.count }.by(1) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'returns todo path and pending count' do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response['count']).to eq 1 expect(json_response['delete_path']).to match(/\/dashboard\/todos\/\d{1}/) end @@ -115,7 +115,7 @@ describe Projects::TodosController do go end.to change { user.todos.count }.by(0) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end it 'does not create todo for merge request user has no access to' do @@ -123,7 +123,7 @@ describe Projects::TodosController do go end.to change { user.todos.count }.by(0) - expect(response).to have_http_status(302) + expect(response).to have_gitlab_http_status(302) end end @@ -136,7 +136,7 @@ describe Projects::TodosController do it "doesn't create todo" do expect { go }.not_to change { user.todos.count } - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/tree_controller_spec.rb b/spec/controllers/projects/tree_controller_spec.rb index 775f3998f5d..65b821c9486 100644 --- a/spec/controllers/projects/tree_controller_spec.rb +++ b/spec/controllers/projects/tree_controller_spec.rb @@ -64,7 +64,7 @@ describe Projects::TreeController do context "valid SHA commit ID with path" do let(:id) { '6d39438/.gitignore' } - it { expect(response).to have_http_status(302) } + it { expect(response).to have_gitlab_http_status(302) } end end diff --git a/spec/controllers/projects/uploads_controller_spec.rb b/spec/controllers/projects/uploads_controller_spec.rb index 488bcf31371..c2550b1efa7 100644 --- a/spec/controllers/projects/uploads_controller_spec.rb +++ b/spec/controllers/projects/uploads_controller_spec.rb @@ -18,7 +18,7 @@ describe Projects::UploadsController do namespace_id: project.namespace.to_param, project_id: project, format: :json - expect(response).to have_http_status(422) + expect(response).to have_gitlab_http_status(422) end end @@ -90,7 +90,7 @@ describe Projects::UploadsController do it "responds with status 200" do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -98,7 +98,7 @@ describe Projects::UploadsController do it "responds with status 404" do go - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -117,7 +117,7 @@ describe Projects::UploadsController do it "responds with status 200" do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -125,7 +125,7 @@ describe Projects::UploadsController do it "responds with status 404" do go - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -151,7 +151,7 @@ describe Projects::UploadsController do it "responds with status 200" do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -192,7 +192,7 @@ describe Projects::UploadsController do it "responds with status 200" do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -200,7 +200,7 @@ describe Projects::UploadsController do it "responds with status 404" do go - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -220,7 +220,7 @@ describe Projects::UploadsController do it "responds with status 200" do go - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end end @@ -228,7 +228,7 @@ describe Projects::UploadsController do it "responds with status 404" do go - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -237,7 +237,7 @@ describe Projects::UploadsController do it "responds with status 404" do go - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end diff --git a/spec/controllers/projects/variables_controller_spec.rb b/spec/controllers/projects/variables_controller_spec.rb index 6957fb43c19..d065cd00d00 100644 --- a/spec/controllers/projects/variables_controller_spec.rb +++ b/spec/controllers/projects/variables_controller_spec.rb @@ -50,7 +50,7 @@ describe Projects::VariablesController do post :update, namespace_id: project.namespace.to_param, project_id: project, id: variable.id, variable: { key: '?', value: variable.value } - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to render_template :show end end -- cgit v1.2.3