Commit 2f40dac3 authored by Jacopo's avatar Jacopo

Refactor `have_http_status` into `have_gitlab_http_status` in the specs

parent b4dc0ba2
---
title: Refactor have_http_status into have_gitlab_http_status
merge_request: 14958
author: Jacopo Beschi @jacopo-beschi
type: added
...@@ -20,7 +20,7 @@ describe Admin::HooksController do ...@@ -20,7 +20,7 @@ describe Admin::HooksController do
post :create, hook: hook_params post :create, hook: hook_params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(SystemHook.all.size).to eq(1) expect(SystemHook.all.size).to eq(1)
expect(SystemHook.first).to have_attributes(hook_params) expect(SystemHook.first).to have_attributes(hook_params)
end end
......
...@@ -22,7 +22,7 @@ describe Admin::ImpersonationsController do ...@@ -22,7 +22,7 @@ describe Admin::ImpersonationsController do
it "responds with status 404" do it "responds with status 404" do
delete :destroy delete :destroy
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it "doesn't sign us in" do it "doesn't sign us in" do
...@@ -46,7 +46,7 @@ describe Admin::ImpersonationsController do ...@@ -46,7 +46,7 @@ describe Admin::ImpersonationsController do
it "responds with status 404" do it "responds with status 404" do
delete :destroy delete :destroy
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it "doesn't sign us in as the impersonator" do it "doesn't sign us in as the impersonator" do
...@@ -65,7 +65,7 @@ describe Admin::ImpersonationsController do ...@@ -65,7 +65,7 @@ describe Admin::ImpersonationsController do
it "responds with status 404" do it "responds with status 404" do
delete :destroy delete :destroy
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it "doesn't sign us in as the impersonator" do it "doesn't sign us in as the impersonator" do
......
...@@ -27,7 +27,7 @@ describe Admin::ProjectsController do ...@@ -27,7 +27,7 @@ describe Admin::ProjectsController do
get :index get :index
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.body).not_to match(pending_delete_project.name) expect(response.body).not_to match(pending_delete_project.name)
expect(response.body).to match(project.name) expect(response.body).to match(project.name)
end end
......
...@@ -11,7 +11,7 @@ describe Admin::RunnersController do ...@@ -11,7 +11,7 @@ describe Admin::RunnersController do
it 'lists all runners' do it 'lists all runners' do
get :index get :index
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -19,13 +19,13 @@ describe Admin::RunnersController do ...@@ -19,13 +19,13 @@ describe Admin::RunnersController do
it 'shows a particular runner' do it 'shows a particular runner' do
get :show, id: runner.id get :show, id: runner.id
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'shows 404 for unknown runner' do it 'shows 404 for unknown runner' do
get :show, id: 0 get :show, id: 0
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -39,7 +39,7 @@ describe Admin::RunnersController do ...@@ -39,7 +39,7 @@ describe Admin::RunnersController do
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(runner.description).to eq(new_desc) expect(runner.description).to eq(new_desc)
end end
end end
...@@ -48,7 +48,7 @@ describe Admin::RunnersController do ...@@ -48,7 +48,7 @@ describe Admin::RunnersController do
it 'destroys the runner' do it 'destroys the runner' do
delete :destroy, id: runner.id delete :destroy, id: runner.id
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 expect(Ci::Runner.find_by(id: runner.id)).to be_nil
end end
end end
...@@ -63,7 +63,7 @@ describe Admin::RunnersController do ...@@ -63,7 +63,7 @@ describe Admin::RunnersController do
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(runner.active).to eq(true) expect(runner.active).to eq(true)
end end
end end
...@@ -78,7 +78,7 @@ describe Admin::RunnersController do ...@@ -78,7 +78,7 @@ describe Admin::RunnersController do
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(runner.active).to eq(false) expect(runner.active).to eq(false)
end end
end end
......
...@@ -20,7 +20,7 @@ describe Admin::ServicesController do ...@@ -20,7 +20,7 @@ describe Admin::ServicesController do
it 'successfully displays the template' do it 'successfully displays the template' do
get :edit, id: service.id get :edit, id: service.id
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -46,7 +46,7 @@ describe Admin::ServicesController do ...@@ -46,7 +46,7 @@ describe Admin::ServicesController do
put :update, id: service.id, service: { active: true } put :update, id: service.id, service: { active: true }
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
it 'does not call the propagation worker when service is not active' do it 'does not call the propagation worker when service is not active' do
...@@ -54,7 +54,7 @@ describe Admin::ServicesController do ...@@ -54,7 +54,7 @@ describe Admin::ServicesController do
put :update, id: service.id, service: { properties: {} } put :update, id: service.id, service: { properties: {} }
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
end end
...@@ -14,7 +14,7 @@ describe Admin::SpamLogsController do ...@@ -14,7 +14,7 @@ describe Admin::SpamLogsController do
it 'lists all spam logs' do it 'lists all spam logs' do
get :index get :index
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -22,14 +22,14 @@ describe Admin::SpamLogsController do ...@@ -22,14 +22,14 @@ describe Admin::SpamLogsController do
it 'removes only the spam log when removing log' do it 'removes only the spam log when removing log' do
expect { delete :destroy, id: first_spam.id }.to change { SpamLog.count }.by(-1) expect { delete :destroy, id: first_spam.id }.to change { SpamLog.count }.by(-1)
expect(User.find(user.id)).to be_truthy expect(User.find(user.id)).to be_truthy
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'removes user and his spam logs when removing the user' do it 'removes user and his spam logs when removing the user' do
delete :destroy, id: first_spam.id, remove_user: true delete :destroy, id: first_spam.id, remove_user: true
expect(flash[:notice]).to eq "User #{user.username} was successfully removed." expect(flash[:notice]).to eq "User #{user.username} was successfully removed."
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(SpamLog.count).to eq(0) expect(SpamLog.count).to eq(0)
expect { User.find(user.id) }.to raise_error(ActiveRecord::RecordNotFound) expect { User.find(user.id) }.to raise_error(ActiveRecord::RecordNotFound)
end end
...@@ -42,7 +42,7 @@ describe Admin::SpamLogsController do ...@@ -42,7 +42,7 @@ describe Admin::SpamLogsController do
it 'submits the log as ham' do it 'submits the log as ham' do
post :mark_as_ham, id: first_spam.id post :mark_as_ham, id: first_spam.id
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(SpamLog.find(first_spam.id).submitted_as_ham).to be_truthy expect(SpamLog.find(first_spam.id).submitted_as_ham).to be_truthy
end end
end end
......
...@@ -19,7 +19,7 @@ describe Admin::UsersController do ...@@ -19,7 +19,7 @@ describe Admin::UsersController do
it 'deletes user and ghosts their contributions' do it 'deletes user and ghosts their contributions' do
delete :destroy, id: user.username, format: :json delete :destroy, id: user.username, format: :json
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(User.exists?(user.id)).to be_falsy expect(User.exists?(user.id)).to be_falsy
expect(issue.reload.author).to be_ghost expect(issue.reload.author).to be_ghost
end end
...@@ -27,7 +27,7 @@ describe Admin::UsersController do ...@@ -27,7 +27,7 @@ describe Admin::UsersController do
it 'deletes the user and their contributions when hard delete is specified' do it 'deletes the user and their contributions when hard delete is specified' do
delete :destroy, id: user.username, hard_delete: true, format: :json delete :destroy, id: user.username, hard_delete: true, format: :json
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(User.exists?(user.id)).to be_falsy expect(User.exists?(user.id)).to be_falsy
expect(Issue.exists?(issue.id)).to be_falsy expect(Issue.exists?(issue.id)).to be_falsy
end end
......
...@@ -61,7 +61,7 @@ describe ApplicationController do ...@@ -61,7 +61,7 @@ describe ApplicationController do
context "when the 'private_token' param is populated with the private token" do context "when the 'private_token' param is populated with the private token" do
it "logs the user in" do it "logs the user in" do
get :index, private_token: user.private_token get :index, private_token: user.private_token
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.body).to eq("authenticated") expect(response.body).to eq("authenticated")
end end
end end
...@@ -70,7 +70,7 @@ describe ApplicationController do ...@@ -70,7 +70,7 @@ describe ApplicationController do
it "logs the user in" do it "logs the user in" do
@request.headers['PRIVATE-TOKEN'] = user.private_token @request.headers['PRIVATE-TOKEN'] = user.private_token
get :index get :index
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.body).to eq("authenticated") expect(response.body).to eq("authenticated")
end end
end end
...@@ -95,7 +95,7 @@ describe ApplicationController do ...@@ -95,7 +95,7 @@ describe ApplicationController do
context "when the 'personal_access_token' param is populated with the personal access token" do context "when the 'personal_access_token' param is populated with the personal access token" do
it "logs the user in" do it "logs the user in" do
get :index, private_token: personal_access_token.token get :index, private_token: personal_access_token.token
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.body).to eq('authenticated') expect(response.body).to eq('authenticated')
end end
end end
...@@ -104,7 +104,7 @@ describe ApplicationController do ...@@ -104,7 +104,7 @@ describe ApplicationController do
it "logs the user in" do it "logs the user in" do
@request.headers["PRIVATE-TOKEN"] = personal_access_token.token @request.headers["PRIVATE-TOKEN"] = personal_access_token.token
get :index get :index
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.body).to eq('authenticated') expect(response.body).to eq('authenticated')
end end
end end
...@@ -158,7 +158,7 @@ describe ApplicationController do ...@@ -158,7 +158,7 @@ describe ApplicationController do
it 'returns 200 response' do it 'returns 200 response' do
get :index, private_token: user.private_token, format: requested_format get :index, private_token: user.private_token, format: requested_format
expect(response).to have_http_status 200 expect(response).to have_gitlab_http_status 200
end end
end end
...@@ -166,7 +166,7 @@ describe ApplicationController do ...@@ -166,7 +166,7 @@ describe ApplicationController do
it 'returns 404 response' do it 'returns 404 response' do
get :index, private_token: user.private_token get :index, private_token: user.private_token
expect(response).to have_http_status 404 expect(response).to have_gitlab_http_status 404
end end
end end
end end
...@@ -183,7 +183,7 @@ describe ApplicationController do ...@@ -183,7 +183,7 @@ describe ApplicationController do
context 'when the request format is atom' do context 'when the request format is atom' do
it "logs the user in" do it "logs the user in" do
get :index, rss_token: user.rss_token, format: :atom get :index, rss_token: user.rss_token, format: :atom
expect(response).to have_http_status 200 expect(response).to have_gitlab_http_status 200
expect(response.body).to eq 'authenticated' expect(response.body).to eq 'authenticated'
end end
end end
...@@ -191,7 +191,7 @@ describe ApplicationController do ...@@ -191,7 +191,7 @@ describe ApplicationController do
context 'when the request format is not atom' do context 'when the request format is not atom' do
it "doesn't log the user in" do it "doesn't log the user in" do
get :index, rss_token: user.rss_token get :index, rss_token: user.rss_token
expect(response.status).not_to have_http_status 200 expect(response.status).not_to have_gitlab_http_status 200
expect(response.body).not_to eq 'authenticated' expect(response.body).not_to eq 'authenticated'
end end
end end
......
...@@ -30,7 +30,7 @@ describe AutocompleteController do ...@@ -30,7 +30,7 @@ describe AutocompleteController do
get(:users, project_id: 'unknown') get(:users, project_id: 'unknown')
end end
it { expect(response).to have_http_status(404) } it { expect(response).to have_gitlab_http_status(404) }
end end
end end
...@@ -59,7 +59,7 @@ describe AutocompleteController do ...@@ -59,7 +59,7 @@ describe AutocompleteController do
get(:users, group_id: 'unknown') get(:users, group_id: 'unknown')
end end
it { expect(response).to have_http_status(404) } it { expect(response).to have_gitlab_http_status(404) }
end end
end end
...@@ -138,7 +138,7 @@ describe AutocompleteController do ...@@ -138,7 +138,7 @@ describe AutocompleteController do
get(:users, project_id: project.id) get(:users, project_id: project.id)
end end
it { expect(response).to have_http_status(404) } it { expect(response).to have_gitlab_http_status(404) }
end end
describe 'GET #users with unknown project' do describe 'GET #users with unknown project' do
...@@ -146,7 +146,7 @@ describe AutocompleteController do ...@@ -146,7 +146,7 @@ describe AutocompleteController do
get(:users, project_id: 'unknown') get(:users, project_id: 'unknown')
end end
it { expect(response).to have_http_status(404) } it { expect(response).to have_gitlab_http_status(404) }
end end
describe 'GET #users with inaccessible group' do describe 'GET #users with inaccessible group' do
...@@ -155,7 +155,7 @@ describe AutocompleteController do ...@@ -155,7 +155,7 @@ describe AutocompleteController do
get(:users, group_id: user.namespace.id) get(:users, group_id: user.namespace.id)
end end
it { expect(response).to have_http_status(404) } it { expect(response).to have_gitlab_http_status(404) }
end end
describe 'GET #users with no project' do describe 'GET #users with no project' do
......
...@@ -24,7 +24,7 @@ describe Boards::IssuesController do ...@@ -24,7 +24,7 @@ describe Boards::IssuesController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
list_issues user: user, board: 999, list: list2 list_issues user: user, board: 999, list: list2
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -62,7 +62,7 @@ describe Boards::IssuesController do ...@@ -62,7 +62,7 @@ describe Boards::IssuesController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
list_issues user: user, board: board, list: 999 list_issues user: user, board: board, list: 999
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -93,7 +93,7 @@ describe Boards::IssuesController do ...@@ -93,7 +93,7 @@ describe Boards::IssuesController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
list_issues user: user, board: board, list: list2 list_issues user: user, board: board, list: list2
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -116,7 +116,7 @@ describe Boards::IssuesController do ...@@ -116,7 +116,7 @@ describe Boards::IssuesController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
create_issue user: user, board: board, list: list1, title: 'New issue' create_issue user: user, board: board, list: list1, title: 'New issue'
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'returns the created issue' do it 'returns the created issue' do
...@@ -131,7 +131,7 @@ describe Boards::IssuesController do ...@@ -131,7 +131,7 @@ describe Boards::IssuesController do
it 'returns an unprocessable entity 422 response' do it 'returns an unprocessable entity 422 response' do
create_issue user: user, board: board, list: list1, title: nil create_issue user: user, board: board, list: list1, title: nil
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
end end
...@@ -141,7 +141,7 @@ describe Boards::IssuesController do ...@@ -141,7 +141,7 @@ describe Boards::IssuesController do
create_issue user: user, board: board, list: list, title: 'New issue' create_issue user: user, board: board, list: list, title: 'New issue'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -149,7 +149,7 @@ describe Boards::IssuesController do ...@@ -149,7 +149,7 @@ describe Boards::IssuesController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
create_issue user: user, board: 999, list: list1, title: 'New issue' create_issue user: user, board: 999, list: list1, title: 'New issue'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -157,7 +157,7 @@ describe Boards::IssuesController do ...@@ -157,7 +157,7 @@ describe Boards::IssuesController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
create_issue user: user, board: board, list: 999, title: 'New issue' create_issue user: user, board: board, list: 999, title: 'New issue'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -166,7 +166,7 @@ describe Boards::IssuesController do ...@@ -166,7 +166,7 @@ describe Boards::IssuesController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
create_issue user: guest, board: board, list: list1, title: 'New issue' create_issue user: guest, board: board, list: list1, title: 'New issue'
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -187,7 +187,7 @@ describe Boards::IssuesController do ...@@ -187,7 +187,7 @@ describe Boards::IssuesController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
move user: user, board: board, issue: issue, from_list_id: list1.id, to_list_id: list2.id move user: user, board: board, issue: issue, from_list_id: list1.id, to_list_id: list2.id
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'moves issue to the desired list' do it 'moves issue to the desired list' do
...@@ -201,19 +201,19 @@ describe Boards::IssuesController do ...@@ -201,19 +201,19 @@ describe Boards::IssuesController do
it 'returns a unprocessable entity 422 response for invalid lists' do it 'returns a unprocessable entity 422 response for invalid lists' do
move user: user, board: board, issue: issue, from_list_id: nil, to_list_id: nil move user: user, board: board, issue: issue, from_list_id: nil, to_list_id: nil
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
it 'returns a not found 404 response for invalid board id' do it 'returns a not found 404 response for invalid board id' do
move user: user, board: 999, issue: issue, from_list_id: list1.id, to_list_id: list2.id move user: user, board: 999, issue: issue, from_list_id: list1.id, to_list_id: list2.id
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'returns a not found 404 response for invalid issue id' do it 'returns a not found 404 response for invalid issue id' do
move user: user, board: board, issue: double(id: 999), from_list_id: list1.id, to_list_id: list2.id move user: user, board: board, issue: double(id: 999), from_list_id: list1.id, to_list_id: list2.id
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -227,7 +227,7 @@ describe Boards::IssuesController do ...@@ -227,7 +227,7 @@ describe Boards::IssuesController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
move user: guest, board: board, issue: issue, from_list_id: list1.id, to_list_id: list2.id move user: guest, board: board, issue: issue, from_list_id: list1.id, to_list_id: list2.id
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
......
...@@ -15,7 +15,7 @@ describe Boards::ListsController do ...@@ -15,7 +15,7 @@ describe Boards::ListsController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
read_board_list user: user, board: board read_board_list user: user, board: board
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
...@@ -39,7 +39,7 @@ describe Boards::ListsController do ...@@ -39,7 +39,7 @@ describe Boards::ListsController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
read_board_list user: user, board: board read_board_list user: user, board: board
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -60,7 +60,7 @@ describe Boards::ListsController do ...@@ -60,7 +60,7 @@ describe Boards::ListsController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
create_board_list user: user, board: board, label_id: label.id create_board_list user: user, board: board, label_id: label.id
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'returns the created list' do it 'returns the created list' do
...@@ -75,7 +75,7 @@ describe Boards::ListsController do ...@@ -75,7 +75,7 @@ describe Boards::ListsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
create_board_list user: user, board: board, label_id: nil create_board_list user: user, board: board, label_id: nil
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -85,7 +85,7 @@ describe Boards::ListsController do ...@@ -85,7 +85,7 @@ describe Boards::ListsController do
create_board_list user: user, board: board, label_id: label.id create_board_list user: user, board: board, label_id: label.id
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -96,7 +96,7 @@ describe Boards::ListsController do ...@@ -96,7 +96,7 @@ describe Boards::ListsController do
create_board_list user: guest, board: board, label_id: label.id create_board_list user: guest, board: board, label_id: label.id
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -119,7 +119,7 @@ describe Boards::ListsController do ...@@ -119,7 +119,7 @@ describe Boards::ListsController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
move user: user, board: board, list: planning, position: 1 move user: user, board: board, list: planning, position: 1
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'moves the list to the desired position' do it 'moves the list to the desired position' do
...@@ -133,7 +133,7 @@ describe Boards::ListsController do ...@@ -133,7 +133,7 @@ describe Boards::ListsController do
it 'returns an unprocessable entity 422 response' do it 'returns an unprocessable entity 422 response' do
move user: user, board: board, list: planning, position: 6 move user: user, board: board, list: planning, position: 6
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
end end
...@@ -141,7 +141,7 @@ describe Boards::ListsController do ...@@ -141,7 +141,7 @@ describe Boards::ListsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
move user: user, board: board, list: 999, position: 1 move user: user, board: board, list: 999, position: 1
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -149,7 +149,7 @@ describe Boards::ListsController do ...@@ -149,7 +149,7 @@ describe Boards::ListsController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
move user: guest, board: board, list: planning, position: 6 move user: guest, board: board, list: planning, position: 6
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -172,7 +172,7 @@ describe Boards::ListsController do ...@@ -172,7 +172,7 @@ describe Boards::ListsController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
remove_board_list user: user, board: board, list: planning remove_board_list user: user, board: board, list: planning
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'removes list from board' do it 'removes list from board' do
...@@ -184,7 +184,7 @@ describe Boards::ListsController do ...@@ -184,7 +184,7 @@ describe Boards::ListsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
remove_board_list user: user, board: board, list: 999 remove_board_list user: user, board: board, list: 999
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -192,7 +192,7 @@ describe Boards::ListsController do ...@@ -192,7 +192,7 @@ describe Boards::ListsController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
remove_board_list user: guest, board: board, list: planning remove_board_list user: guest, board: board, list: planning
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -212,7 +212,7 @@ describe Boards::ListsController do ...@@ -212,7 +212,7 @@ describe Boards::ListsController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
generate_default_lists user: user, board: board generate_default_lists user: user, board: board
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'returns the defaults lists' do it 'returns the defaults lists' do
...@@ -228,7 +228,7 @@ describe Boards::ListsController do ...@@ -228,7 +228,7 @@ describe Boards::ListsController do
generate_default_lists user: user, board: board generate_default_lists user: user, board: board
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
end end
...@@ -236,7 +236,7 @@ describe Boards::ListsController do ...@@ -236,7 +236,7 @@ describe Boards::ListsController do
it 'returns a forbidden 403 response' do it 'returns a forbidden 403 response' do
generate_default_lists user: guest, board: board generate_default_lists user: guest, board: board
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
......
...@@ -32,7 +32,7 @@ describe Dashboard::MilestonesController do ...@@ -32,7 +32,7 @@ describe Dashboard::MilestonesController do
it 'shows milestone page' do it 'shows milestone page' do
view_milestone view_milestone
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -18,19 +18,19 @@ describe Dashboard::TodosController do ...@@ -18,19 +18,19 @@ describe Dashboard::TodosController do
get :index, project_id: unauthorized_project.id get :index, project_id: unauthorized_project.id
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'renders 404 when given project does not exists' do it 'renders 404 when given project does not exists' do
get :index, project_id: 999 get :index, project_id: 999
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'renders 200 when filtering for "any project" todos' do it 'renders 200 when filtering for "any project" todos' do
get :index, project_id: '' get :index, project_id: ''
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'renders 200 when user has access on given project' do it 'renders 200 when user has access on given project' do
...@@ -38,7 +38,7 @@ describe Dashboard::TodosController do ...@@ -38,7 +38,7 @@ describe Dashboard::TodosController do
get :index, project_id: authorized_project.id get :index, project_id: authorized_project.id
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -61,7 +61,7 @@ describe Dashboard::TodosController do ...@@ -61,7 +61,7 @@ describe Dashboard::TodosController do
get :index, page: last_page get :index, page: last_page
expect(assigns(:todos).current_page).to eq(last_page) expect(assigns(:todos).current_page).to eq(last_page)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'does not redirect to external sites when provided a host field' do it 'does not redirect to external sites when provided a host field' do
...@@ -104,7 +104,7 @@ describe Dashboard::TodosController do ...@@ -104,7 +104,7 @@ describe Dashboard::TodosController do
patch :restore, id: todo.id patch :restore, id: todo.id
expect(todo.reload).to be_pending expect(todo.reload).to be_pending
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response).to eq({ "count" => "1", "done_count" => "0" }) expect(json_response).to eq({ "count" => "1", "done_count" => "0" })
end end
end end
...@@ -118,7 +118,7 @@ describe Dashboard::TodosController do ...@@ -118,7 +118,7 @@ describe Dashboard::TodosController do
todos.each do |todo| todos.each do |todo|
expect(todo.reload).to be_pending expect(todo.reload).to be_pending
end end
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response).to eq({ 'count' => '2', 'done_count' => '0' }) expect(json_response).to eq({ 'count' => '2', 'done_count' => '0' })
end end
end end
......
...@@ -8,7 +8,7 @@ describe Groups::GroupMembersController do ...@@ -8,7 +8,7 @@ describe Groups::GroupMembersController do
it 'renders index with 200 status code' do it 'renders index with 200 status code' do
get :index, group_id: group get :index, group_id: group
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:index) expect(response).to render_template(:index)
end end
end end
...@@ -30,7 +30,7 @@ describe Groups::GroupMembersController do ...@@ -30,7 +30,7 @@ describe Groups::GroupMembersController do
user_ids: group_user.id, user_ids: group_user.id,
access_level: Gitlab::Access::GUEST access_level: Gitlab::Access::GUEST
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
expect(group.users).not_to include group_user expect(group.users).not_to include group_user
end end
end end
...@@ -73,7 +73,7 @@ describe Groups::GroupMembersController do ...@@ -73,7 +73,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
delete :destroy, group_id: group, id: 42 delete :destroy, group_id: group, id: 42
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -86,7 +86,7 @@ describe Groups::GroupMembersController do ...@@ -86,7 +86,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
delete :destroy, group_id: group, id: member delete :destroy, group_id: group, id: member
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
expect(group.members).to include member expect(group.members).to include member
end end
end end
...@@ -123,7 +123,7 @@ describe Groups::GroupMembersController do ...@@ -123,7 +123,7 @@ describe Groups::GroupMembersController do
it 'returns 404' do it 'returns 404' do
delete :leave, group_id: group delete :leave, group_id: group
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -144,7 +144,7 @@ describe Groups::GroupMembersController do ...@@ -144,7 +144,7 @@ describe Groups::GroupMembersController do
it 'supports json request' do it 'supports json request' do
delete :leave, group_id: group, format: :json delete :leave, group_id: group, format: :json
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['notice']).to eq "You left the \"#{group.name}\" group." expect(json_response['notice']).to eq "You left the \"#{group.name}\" group."
end end
end end
...@@ -157,7 +157,7 @@ describe Groups::GroupMembersController do ...@@ -157,7 +157,7 @@ describe Groups::GroupMembersController do
it 'cannot removes himself from the group' do it 'cannot removes himself from the group' do
delete :leave, group_id: group delete :leave, group_id: group
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -204,7 +204,7 @@ describe Groups::GroupMembersController do ...@@ -204,7 +204,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
post :approve_access_request, group_id: group, id: 42 post :approve_access_request, group_id: group, id: 42
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -217,7 +217,7 @@ describe Groups::GroupMembersController do ...@@ -217,7 +217,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
post :approve_access_request, group_id: group, id: member post :approve_access_request, group_id: group, id: member
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
expect(group.members).not_to include member expect(group.members).not_to include member
end end
end end
......
...@@ -16,7 +16,7 @@ describe Groups::LabelsController do ...@@ -16,7 +16,7 @@ describe Groups::LabelsController do
post :toggle_subscription, group_id: group.to_param, id: label.to_param post :toggle_subscription, group_id: group.to_param, id: label.to_param
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -35,7 +35,7 @@ describe Groups::MilestonesController do ...@@ -35,7 +35,7 @@ describe Groups::MilestonesController do
it 'shows group milestones page' do it 'shows group milestones page' do
get :index, group_id: group.to_param get :index, group_id: group.to_param
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
context 'as JSON' do context 'as JSON' do
...@@ -51,7 +51,7 @@ describe Groups::MilestonesController do ...@@ -51,7 +51,7 @@ describe Groups::MilestonesController do
expect(milestones.count).to eq(2) expect(milestones.count).to eq(2)
expect(milestones.first["title"]).to eq("group milestone") expect(milestones.first["title"]).to eq("group milestone")
expect(milestones.second["title"]).to eq("legacy") expect(milestones.second["title"]).to eq("legacy")
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
end end
...@@ -153,7 +153,7 @@ describe Groups::MilestonesController do ...@@ -153,7 +153,7 @@ describe Groups::MilestonesController do
it 'does not redirect' do it 'does not redirect' do
get :index, group_id: group.to_param get :index, group_id: group.to_param
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -172,7 +172,7 @@ describe Groups::MilestonesController do ...@@ -172,7 +172,7 @@ describe Groups::MilestonesController do
it 'does not redirect' do it 'does not redirect' do
get :show, group_id: group.to_param, id: title get :show, group_id: group.to_param, id: title
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -242,7 +242,7 @@ describe Groups::MilestonesController do ...@@ -242,7 +242,7 @@ describe Groups::MilestonesController do
group_id: group.to_param, group_id: group.to_param,
milestone: { title: title } milestone: { title: title }
expect(response).not_to have_http_status(404) expect(response).not_to have_gitlab_http_status(404)
end end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
...@@ -250,7 +250,7 @@ describe Groups::MilestonesController do ...@@ -250,7 +250,7 @@ describe Groups::MilestonesController do
group_id: group.to_param, group_id: group.to_param,
milestone: { title: title } milestone: { title: title }
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -262,7 +262,7 @@ describe Groups::MilestonesController do ...@@ -262,7 +262,7 @@ describe Groups::MilestonesController do
group_id: redirect_route.path, group_id: redirect_route.path,
milestone: { title: title } milestone: { title: title }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -13,7 +13,7 @@ describe Groups::Settings::CiCdController do ...@@ -13,7 +13,7 @@ describe Groups::Settings::CiCdController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, group_id: group get :show, group_id: group
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
end end
......
...@@ -48,7 +48,7 @@ describe Groups::VariablesController do ...@@ -48,7 +48,7 @@ describe Groups::VariablesController do
post :update, group_id: group, post :update, group_id: group,
id: variable.id, variable: { key: '?', value: variable.value } 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 expect(response).to render_template :show
end end
end end
......
...@@ -238,7 +238,7 @@ describe GroupsController do ...@@ -238,7 +238,7 @@ describe GroupsController do
it 'updates the path successfully' do it 'updates the path successfully' do
post :update, id: group.to_param, group: { path: 'new_path' } post :update, id: group.to_param, group: { path: 'new_path' }
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(controller).to set_flash[:notice] expect(controller).to set_flash[:notice]
end end
...@@ -309,7 +309,7 @@ describe GroupsController do ...@@ -309,7 +309,7 @@ describe GroupsController do
it 'does not redirect' do it 'does not redirect' do
get :issues, id: group.to_param get :issues, id: group.to_param
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -328,7 +328,7 @@ describe GroupsController do ...@@ -328,7 +328,7 @@ describe GroupsController do
it 'does not redirect' do it 'does not redirect' do
get :show, id: group.to_param get :show, id: group.to_param
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -395,13 +395,13 @@ describe GroupsController do ...@@ -395,13 +395,13 @@ describe GroupsController do
it 'does not 404' do it 'does not 404' do
post :update, id: group.to_param.upcase, group: { path: 'new_path' } post :update, id: group.to_param.upcase, group: { path: 'new_path' }
expect(response).not_to have_http_status(404) expect(response).not_to have_gitlab_http_status(404)
end end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
post :update, id: group.to_param.upcase, group: { path: 'new_path' } post :update, id: group.to_param.upcase, group: { path: 'new_path' }
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -411,7 +411,7 @@ describe GroupsController do ...@@ -411,7 +411,7 @@ describe GroupsController do
it 'returns not found' do it 'returns not found' do
post :update, id: redirect_route.path, group: { path: 'new_path' } post :update, id: redirect_route.path, group: { path: 'new_path' }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -421,13 +421,13 @@ describe GroupsController do ...@@ -421,13 +421,13 @@ describe GroupsController do
it 'does not 404' do it 'does not 404' do
delete :destroy, id: group.to_param.upcase delete :destroy, id: group.to_param.upcase
expect(response).not_to have_http_status(404) expect(response).not_to have_gitlab_http_status(404)
end end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
delete :destroy, id: group.to_param.upcase delete :destroy, id: group.to_param.upcase
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -437,7 +437,7 @@ describe GroupsController do ...@@ -437,7 +437,7 @@ describe GroupsController do
it 'returns not found' do it 'returns not found' do
delete :destroy, id: redirect_route.path delete :destroy, id: redirect_route.path
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -100,7 +100,7 @@ describe HealthCheckController do ...@@ -100,7 +100,7 @@ describe HealthCheckController do
it 'supports failure plaintext response' do it 'supports failure plaintext response' do
get :index get :index
expect(response).to have_http_status(500) expect(response).to have_gitlab_http_status(500)
expect(response.content_type).to eq 'text/plain' expect(response.content_type).to eq 'text/plain'
expect(response.body).to include('The server is on fire') expect(response.body).to include('The server is on fire')
end end
...@@ -108,7 +108,7 @@ describe HealthCheckController do ...@@ -108,7 +108,7 @@ describe HealthCheckController do
it 'supports failure json response' do it 'supports failure json response' do
get :index, format: :json get :index, format: :json
expect(response).to have_http_status(500) expect(response).to have_gitlab_http_status(500)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
expect(json_response['healthy']).to be false expect(json_response['healthy']).to be false
expect(json_response['message']).to include('The server is on fire') expect(json_response['message']).to include('The server is on fire')
...@@ -117,7 +117,7 @@ describe HealthCheckController do ...@@ -117,7 +117,7 @@ describe HealthCheckController do
it 'supports failure xml response' do it 'supports failure xml response' do
get :index, format: :xml get :index, format: :xml
expect(response).to have_http_status(500) expect(response).to have_gitlab_http_status(500)
expect(response.content_type).to eq 'application/xml' expect(response.content_type).to eq 'application/xml'
expect(xml_response['healthy']).to be false expect(xml_response['healthy']).to be false
expect(xml_response['message']).to include('The server is on fire') expect(xml_response['message']).to include('The server is on fire')
...@@ -126,7 +126,7 @@ describe HealthCheckController do ...@@ -126,7 +126,7 @@ describe HealthCheckController do
it 'supports failure responses for specific checks' do it 'supports failure responses for specific checks' do
get :index, checks: 'email', format: :json get :index, checks: 'email', format: :json
expect(response).to have_http_status(500) expect(response).to have_gitlab_http_status(500)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
expect(json_response['healthy']).to be false expect(json_response['healthy']).to be false
expect(json_response['message']).to include('Email is on fire') expect(json_response['message']).to include('Email is on fire')
......
...@@ -100,7 +100,7 @@ describe HelpController do ...@@ -100,7 +100,7 @@ describe HelpController do
context 'for UI Development Kit' do context 'for UI Development Kit' do
it 'renders found' do it 'renders found' do
get :ui get :ui
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
......
...@@ -15,7 +15,7 @@ describe InvitesController do ...@@ -15,7 +15,7 @@ describe InvitesController do
get :accept, id: token get :accept, id: token
member.reload member.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(member.user).to eq(user) expect(member.user).to eq(user)
expect(flash[:notice]).to include 'You have been granted' expect(flash[:notice]).to include 'You have been granted'
end end
...@@ -26,7 +26,7 @@ describe InvitesController do ...@@ -26,7 +26,7 @@ describe InvitesController do
get :decline, id: token get :decline, id: token
expect {member.reload}.to raise_error ActiveRecord::RecordNotFound expect {member.reload}.to raise_error ActiveRecord::RecordNotFound
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(flash[:notice]).to include 'You have declined the invitation to join' expect(flash[:notice]).to include 'You have declined the invitation to join'
end end
end end
......
...@@ -110,7 +110,7 @@ describe NotificationSettingsController do ...@@ -110,7 +110,7 @@ describe NotificationSettingsController do
project_id: private_project.id, project_id: private_project.id,
notification_setting: { level: :participating } notification_setting: { level: :participating }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -172,7 +172,7 @@ describe NotificationSettingsController do ...@@ -172,7 +172,7 @@ describe NotificationSettingsController do
id: notification_setting, id: notification_setting,
notification_setting: { level: :participating } notification_setting: { level: :participating }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -12,7 +12,7 @@ describe Oauth::ApplicationsController do ...@@ -12,7 +12,7 @@ describe Oauth::ApplicationsController do
it 'shows list of applications' do it 'shows list of applications' do
get :index get :index
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'redirects back to profile page if OAuth applications are disabled' do it 'redirects back to profile page if OAuth applications are disabled' do
...@@ -21,7 +21,7 @@ describe Oauth::ApplicationsController do ...@@ -21,7 +21,7 @@ describe Oauth::ApplicationsController do
get :index get :index
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to(profile_path) expect(response).to redirect_to(profile_path)
end end
end end
......
...@@ -28,7 +28,7 @@ describe Oauth::AuthorizationsController do ...@@ -28,7 +28,7 @@ describe Oauth::AuthorizationsController do
it 'returns 200 code and renders error view' do it 'returns 200 code and renders error view' do
get :new get :new
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('doorkeeper/authorizations/error') expect(response).to render_template('doorkeeper/authorizations/error')
end end
end end
...@@ -37,7 +37,7 @@ describe Oauth::AuthorizationsController do ...@@ -37,7 +37,7 @@ describe Oauth::AuthorizationsController do
it 'returns 200 code and renders view' do it 'returns 200 code and renders view' do
get :new, params get :new, params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('doorkeeper/authorizations/new') expect(response).to render_template('doorkeeper/authorizations/new')
end end
...@@ -48,7 +48,7 @@ describe Oauth::AuthorizationsController do ...@@ -48,7 +48,7 @@ describe Oauth::AuthorizationsController do
get :new, params get :new, params
expect(request.session['user_return_to']).to be_nil expect(request.session['user_return_to']).to be_nil
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
end end
......
...@@ -12,7 +12,7 @@ describe PasswordsController do ...@@ -12,7 +12,7 @@ describe PasswordsController do
post :create post :create
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
......
...@@ -11,7 +11,7 @@ describe Profiles::AccountsController do ...@@ -11,7 +11,7 @@ describe Profiles::AccountsController do
it 'renders 404 if someone tries to unlink a non existent provider' do it 'renders 404 if someone tries to unlink a non existent provider' do
delete :unlink, provider: 'github' delete :unlink, provider: 'github'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
[:saml, :cas3].each do |provider| [:saml, :cas3].each do |provider|
...@@ -23,7 +23,7 @@ describe Profiles::AccountsController do ...@@ -23,7 +23,7 @@ describe Profiles::AccountsController do
delete :unlink, provider: provider.to_s delete :unlink, provider: provider.to_s
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(user.reload.identities).to include(identity) expect(user.reload.identities).to include(identity)
end end
end end
...@@ -38,7 +38,7 @@ describe Profiles::AccountsController do ...@@ -38,7 +38,7 @@ describe Profiles::AccountsController do
delete :unlink, provider: provider.to_s delete :unlink, provider: provider.to_s
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(user.reload.identities).not_to include(identity) expect(user.reload.identities).not_to include(identity)
end end
end end
......
...@@ -60,7 +60,7 @@ describe Projects::ArtifactsController do ...@@ -60,7 +60,7 @@ describe Projects::ArtifactsController do
it 'renders the file view' do it 'renders the file view' do
get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt' 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
end end
...@@ -78,7 +78,7 @@ describe Projects::ArtifactsController do ...@@ -78,7 +78,7 @@ describe Projects::ArtifactsController do
it 'renders the file view' do it 'renders the file view' do
get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt' 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') expect(response).to render_template('projects/artifacts/file')
end end
end end
...@@ -106,7 +106,7 @@ describe Projects::ArtifactsController do ...@@ -106,7 +106,7 @@ describe Projects::ArtifactsController do
it 'does not redirect the request' 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' 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') expect(response).to render_template('projects/artifacts/file')
end end
end end
...@@ -143,7 +143,7 @@ describe Projects::ArtifactsController do ...@@ -143,7 +143,7 @@ describe Projects::ArtifactsController do
context 'cannot find the job' do context 'cannot find the job' do
shared_examples 'not found' 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 end
context 'has no such ref' do context 'has no such ref' do
......
...@@ -13,13 +13,13 @@ describe Projects::BadgesController do ...@@ -13,13 +13,13 @@ describe Projects::BadgesController do
it 'requests the pipeline badge successfully' do it 'requests the pipeline badge successfully' do
get_badge(:pipeline) get_badge(:pipeline)
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
it 'requests the coverage badge successfully' do it 'requests the coverage badge successfully' do
get_badge(:coverage) get_badge(:coverage)
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
def get_badge(badge) def get_badge(badge)
......
...@@ -28,7 +28,7 @@ describe Projects::BlameController do ...@@ -28,7 +28,7 @@ describe Projects::BlameController do
context "invalid file" do context "invalid file" do
let(:id) { 'master/files/ruby/missing_file.rb'} 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 end
end end
...@@ -153,7 +153,7 @@ describe Projects::BlobController do ...@@ -153,7 +153,7 @@ describe Projects::BlobController do
end end
it 'redirects to blob show' do it 'redirects to blob show' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -167,7 +167,7 @@ describe Projects::BlobController do ...@@ -167,7 +167,7 @@ describe Projects::BlobController do
end end
it 'redirects to blob show' do it 'redirects to blob show' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
......
...@@ -45,7 +45,7 @@ describe Projects::BoardsController do ...@@ -45,7 +45,7 @@ describe Projects::BoardsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
list_boards list_boards
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -85,7 +85,7 @@ describe Projects::BoardsController do ...@@ -85,7 +85,7 @@ describe Projects::BoardsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
read_board board: board read_board board: board
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -95,7 +95,7 @@ describe Projects::BoardsController do ...@@ -95,7 +95,7 @@ describe Projects::BoardsController do
read_board board: another_board read_board board: another_board
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
......
...@@ -128,7 +128,7 @@ describe Projects::BranchesController do ...@@ -128,7 +128,7 @@ describe Projects::BranchesController do
issue_iid: issue.iid issue_iid: issue.iid
expect(response.location).to include(project_new_blob_path(project, branch)) 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
end end
...@@ -161,7 +161,7 @@ describe Projects::BranchesController do ...@@ -161,7 +161,7 @@ describe Projects::BranchesController do
it 'returns a successful 200 response' do it 'returns a successful 200 response' do
create_branch name: 'my-branch', ref: 'master' create_branch name: 'my-branch', ref: 'master'
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'returns the created branch' do it 'returns the created branch' do
...@@ -175,7 +175,7 @@ describe Projects::BranchesController do ...@@ -175,7 +175,7 @@ describe Projects::BranchesController do
it 'returns an unprocessable entity 422 response' do it 'returns an unprocessable entity 422 response' do
create_branch name: "<script>alert('merge');</script>", ref: "<script>alert('ref');</script>" create_branch name: "<script>alert('merge');</script>", ref: "<script>alert('ref');</script>"
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
end end
...@@ -202,7 +202,7 @@ describe Projects::BranchesController do ...@@ -202,7 +202,7 @@ describe Projects::BranchesController do
namespace_id: project.namespace, namespace_id: project.namespace,
project_id: project project_id: project
expect(response).to have_http_status(303) expect(response).to have_gitlab_http_status(303)
end end
end end
...@@ -226,28 +226,28 @@ describe Projects::BranchesController do ...@@ -226,28 +226,28 @@ describe Projects::BranchesController do
context "valid branch name, valid source" do context "valid branch name, valid source" do
let(:branch) { "feature" } 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 } it { expect(response.body).to be_blank }
end end
context "valid branch name with unencoded slashes" do context "valid branch name with unencoded slashes" do
let(:branch) { "improve/awesome" } 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 } it { expect(response.body).to be_blank }
end end
context "valid branch name with encoded slashes" do context "valid branch name with encoded slashes" do
let(:branch) { "improve%2Fawesome" } 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 } it { expect(response.body).to be_blank }
end end
context "invalid branch name, valid ref" do context "invalid branch name, valid ref" do
let(:branch) { "no-branch" } 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 } it { expect(response.body).to be_blank }
end end
end end
...@@ -263,7 +263,7 @@ describe Projects::BranchesController do ...@@ -263,7 +263,7 @@ describe Projects::BranchesController do
expect(json_response).to eql("message" => 'Branch was removed') expect(json_response).to eql("message" => 'Branch was removed')
end end
it { expect(response).to have_http_status(200) } it { expect(response).to have_gitlab_http_status(200) }
end end
context 'valid branch name with unencoded slashes' do context 'valid branch name with unencoded slashes' do
...@@ -273,7 +273,7 @@ describe Projects::BranchesController do ...@@ -273,7 +273,7 @@ describe Projects::BranchesController do
expect(json_response).to eql('message' => 'Branch was removed') expect(json_response).to eql('message' => 'Branch was removed')
end end
it { expect(response).to have_http_status(200) } it { expect(response).to have_gitlab_http_status(200) }
end end
context "valid branch name with encoded slashes" do context "valid branch name with encoded slashes" do
...@@ -283,7 +283,7 @@ describe Projects::BranchesController do ...@@ -283,7 +283,7 @@ describe Projects::BranchesController do
expect(json_response).to eql('message' => 'Branch was removed') expect(json_response).to eql('message' => 'Branch was removed')
end end
it { expect(response).to have_http_status(200) } it { expect(response).to have_gitlab_http_status(200) }
end end
context 'invalid branch name, valid ref' do context 'invalid branch name, valid ref' do
...@@ -293,7 +293,7 @@ describe Projects::BranchesController do ...@@ -293,7 +293,7 @@ describe Projects::BranchesController do
expect(json_response).to eql('message' => 'No such branch') expect(json_response).to eql('message' => 'No such branch')
end end
it { expect(response).to have_http_status(404) } it { expect(response).to have_gitlab_http_status(404) }
end end
end end
...@@ -341,7 +341,7 @@ describe Projects::BranchesController do ...@@ -341,7 +341,7 @@ describe Projects::BranchesController do
it 'responds with status 404' do it 'responds with status 404' do
destroy_all_merged destroy_all_merged
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -379,7 +379,7 @@ describe Projects::BranchesController do ...@@ -379,7 +379,7 @@ describe Projects::BranchesController do
project_id: project, project_id: project,
format: :html format: :html
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
......
...@@ -169,7 +169,7 @@ describe Projects::ClustersController do ...@@ -169,7 +169,7 @@ describe Projects::ClustersController do
it "responds with matching schema" do it "responds with matching schema" do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('cluster_status') expect(response).to match_response_schema('cluster_status')
end end
end end
...@@ -189,14 +189,14 @@ describe Projects::ClustersController do ...@@ -189,14 +189,14 @@ describe Projects::ClustersController do
it "allows to update cluster" do it "allows to update cluster" do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include("Save") expect(response.body).to include("Save")
end end
it "allows remove integration" do it "allows remove integration" do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include("Remove integration") expect(response.body).to include("Remove integration")
end end
end end
...@@ -207,7 +207,7 @@ describe Projects::ClustersController do ...@@ -207,7 +207,7 @@ describe Projects::ClustersController do
it "does not allow to access page" do it "does not allow to access page" do
subject subject
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -251,7 +251,7 @@ describe Projects::ClustersController do ...@@ -251,7 +251,7 @@ describe Projects::ClustersController do
it "rejects changes" do it "rejects changes" do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
end end
...@@ -263,7 +263,7 @@ describe Projects::ClustersController do ...@@ -263,7 +263,7 @@ describe Projects::ClustersController do
it "does not allow to update cluster" do it "does not allow to update cluster" do
subject subject
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -292,7 +292,7 @@ describe Projects::ClustersController do ...@@ -292,7 +292,7 @@ describe Projects::ClustersController do
it "does not allow to destroy cluster" do it "does not allow to destroy cluster" do
subject subject
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -157,7 +157,7 @@ describe Projects::CommitController do ...@@ -157,7 +157,7 @@ describe Projects::CommitController do
id: commit.id) id: commit.id)
expect(response).not_to be_success expect(response).not_to be_success
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -206,7 +206,7 @@ describe Projects::CommitController do ...@@ -206,7 +206,7 @@ describe Projects::CommitController do
id: master_pickable_commit.id) id: master_pickable_commit.id)
expect(response).not_to be_success expect(response).not_to be_success
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -286,7 +286,7 @@ describe Projects::CommitController do ...@@ -286,7 +286,7 @@ describe Projects::CommitController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -298,7 +298,7 @@ describe Projects::CommitController do ...@@ -298,7 +298,7 @@ describe Projects::CommitController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -309,7 +309,7 @@ describe Projects::CommitController do ...@@ -309,7 +309,7 @@ describe Projects::CommitController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -356,7 +356,7 @@ describe Projects::CommitController do ...@@ -356,7 +356,7 @@ describe Projects::CommitController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -133,7 +133,7 @@ describe Projects::CompareController do ...@@ -133,7 +133,7 @@ describe Projects::CompareController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -145,7 +145,7 @@ describe Projects::CompareController do ...@@ -145,7 +145,7 @@ describe Projects::CompareController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -156,7 +156,7 @@ describe Projects::CompareController do ...@@ -156,7 +156,7 @@ describe Projects::CompareController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -166,7 +166,7 @@ describe Projects::CompareController do ...@@ -166,7 +166,7 @@ describe Projects::CompareController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -67,7 +67,7 @@ describe Projects::DeploymentsController do ...@@ -67,7 +67,7 @@ describe Projects::DeploymentsController do
it 'returns a empty response 204 resposne' do it 'returns a empty response 204 resposne' do
get :metrics, deployment_params(id: deployment.id) 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('') expect(response.body).to eq('')
end end
end end
...@@ -142,7 +142,7 @@ describe Projects::DeploymentsController do ...@@ -142,7 +142,7 @@ describe Projects::DeploymentsController do
it 'returns a empty response 204 response' do it 'returns a empty response 204 response' do
get :additional_metrics, deployment_params(id: deployment.id, format: :json) 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('') expect(response.body).to eq('')
end end
end end
......
...@@ -25,7 +25,7 @@ describe Projects::DiscussionsController do ...@@ -25,7 +25,7 @@ describe Projects::DiscussionsController do
it "returns status 404" do it "returns status 404" do
post :resolve, request_params post :resolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -42,7 +42,7 @@ describe Projects::DiscussionsController do ...@@ -42,7 +42,7 @@ describe Projects::DiscussionsController do
it "returns status 404" do it "returns status 404" do
post :resolve, request_params post :resolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -69,7 +69,7 @@ describe Projects::DiscussionsController do ...@@ -69,7 +69,7 @@ describe Projects::DiscussionsController do
it "returns status 200" do it "returns status 200" do
post :resolve, request_params post :resolve, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -86,7 +86,7 @@ describe Projects::DiscussionsController do ...@@ -86,7 +86,7 @@ describe Projects::DiscussionsController do
it "returns status 404" do it "returns status 404" do
delete :unresolve, request_params delete :unresolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -103,7 +103,7 @@ describe Projects::DiscussionsController do ...@@ -103,7 +103,7 @@ describe Projects::DiscussionsController do
it "returns status 404" do it "returns status 404" do
delete :unresolve, request_params delete :unresolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -117,7 +117,7 @@ describe Projects::DiscussionsController do ...@@ -117,7 +117,7 @@ describe Projects::DiscussionsController do
it "returns status 200" do it "returns status 200" do
delete :unresolve, request_params delete :unresolve, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
......
...@@ -19,7 +19,7 @@ describe Projects::EnvironmentsController do ...@@ -19,7 +19,7 @@ describe Projects::EnvironmentsController do
it 'responds with status code 200' do it 'responds with status code 200' do
get :index, environment_params get :index, environment_params
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -59,7 +59,7 @@ describe Projects::EnvironmentsController do ...@@ -59,7 +59,7 @@ describe Projects::EnvironmentsController do
end end
it 'sets the polling interval header' do 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") expect(response.headers['Poll-Interval']).to eq("3000")
end end
end end
...@@ -137,7 +137,7 @@ describe Projects::EnvironmentsController do ...@@ -137,7 +137,7 @@ describe Projects::EnvironmentsController do
params[:id] = 12345 params[:id] = 12345
get :show, params get :show, params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -155,7 +155,7 @@ describe Projects::EnvironmentsController do ...@@ -155,7 +155,7 @@ describe Projects::EnvironmentsController do
patch_params = environment_params.merge(environment: { external_url: 'https://git.gitlab.com' }) patch_params = environment_params.merge(environment: { external_url: 'https://git.gitlab.com' })
patch :update, patch_params patch :update, patch_params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -166,7 +166,7 @@ describe Projects::EnvironmentsController do ...@@ -166,7 +166,7 @@ describe Projects::EnvironmentsController do
patch :stop, environment_params(format: :json) patch :stop, environment_params(format: :json)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -179,7 +179,7 @@ describe Projects::EnvironmentsController do ...@@ -179,7 +179,7 @@ describe Projects::EnvironmentsController do
patch :stop, environment_params(format: :json) 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( expect(json_response).to eq(
{ 'redirect_url' => { 'redirect_url' =>
project_job_url(project, action) }) project_job_url(project, action) })
...@@ -193,7 +193,7 @@ describe Projects::EnvironmentsController do ...@@ -193,7 +193,7 @@ describe Projects::EnvironmentsController do
patch :stop, environment_params(format: :json) 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( expect(json_response).to eq(
{ 'redirect_url' => { 'redirect_url' =>
project_environment_url(project, environment) }) project_environment_url(project, environment) })
...@@ -206,7 +206,7 @@ describe Projects::EnvironmentsController do ...@@ -206,7 +206,7 @@ describe Projects::EnvironmentsController do
it 'responds with a status code 200' do it 'responds with a status code 200' do
get :terminal, environment_params get :terminal, environment_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'loads the terminals for the enviroment' do it 'loads the terminals for the enviroment' do
...@@ -220,7 +220,7 @@ describe Projects::EnvironmentsController do ...@@ -220,7 +220,7 @@ describe Projects::EnvironmentsController do
it 'responds with a status code 404' do it 'responds with a status code 404' do
get :terminal, environment_params(id: 666) get :terminal, environment_params(id: 666)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -244,7 +244,7 @@ describe Projects::EnvironmentsController do ...@@ -244,7 +244,7 @@ describe Projects::EnvironmentsController do
get :terminal_websocket_authorize, environment_params 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.headers["Content-Type"]).to eq(Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE)
expect(response.body).to eq('{"workhorse":"response"}') expect(response.body).to eq('{"workhorse":"response"}')
end end
...@@ -254,7 +254,7 @@ describe Projects::EnvironmentsController do ...@@ -254,7 +254,7 @@ describe Projects::EnvironmentsController do
it 'returns 404' do it 'returns 404' do
get :terminal_websocket_authorize, environment_params(id: 666) 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 end
end end
...@@ -290,7 +290,7 @@ describe Projects::EnvironmentsController do ...@@ -290,7 +290,7 @@ describe Projects::EnvironmentsController do
it 'returns a metrics JSON document' do it 'returns a metrics JSON document' do
get :metrics, environment_params(format: :json) 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({}) expect(json_response).to eq({})
end end
end end
...@@ -330,7 +330,7 @@ describe Projects::EnvironmentsController do ...@@ -330,7 +330,7 @@ describe Projects::EnvironmentsController do
it 'returns a metrics JSON document' do it 'returns a metrics JSON document' do
get :additional_metrics, environment_params(format: :json) 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({}) expect(json_response).to eq({})
end end
end end
......
...@@ -89,7 +89,7 @@ describe Projects::ForksController do ...@@ -89,7 +89,7 @@ describe Projects::ForksController do
get_new get_new
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -118,7 +118,7 @@ describe Projects::ForksController do ...@@ -118,7 +118,7 @@ describe Projects::ForksController do
post_create 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)) expect(response).to redirect_to(namespace_project_import_path(user.namespace, project))
end end
end end
......
...@@ -20,7 +20,7 @@ describe Projects::IssuesController do ...@@ -20,7 +20,7 @@ describe Projects::IssuesController do
get :index, namespace_id: project.namespace, project_id: project 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
end end
...@@ -28,7 +28,7 @@ describe Projects::IssuesController do ...@@ -28,7 +28,7 @@ describe Projects::IssuesController do
it 'renders the "index" template' do it 'renders the "index" template' do
get :index, namespace_id: project.namespace, project_id: project 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) expect(response).to render_template(:index)
end end
end end
...@@ -45,7 +45,7 @@ describe Projects::IssuesController do ...@@ -45,7 +45,7 @@ describe Projects::IssuesController do
it "returns index" do it "returns index" do
get :index, namespace_id: project.namespace, project_id: project 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
it "returns 301 if request path doesn't match project path" do it "returns 301 if request path doesn't match project path" do
...@@ -59,7 +59,7 @@ describe Projects::IssuesController do ...@@ -59,7 +59,7 @@ describe Projects::IssuesController do
project.save! project.save!
get :index, namespace_id: project.namespace, project_id: project 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
end end
...@@ -89,7 +89,7 @@ describe Projects::IssuesController do ...@@ -89,7 +89,7 @@ describe Projects::IssuesController do
page: last_page.to_param page: last_page.to_param
expect(assigns(:issues).current_page).to eq(last_page) 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 end
it 'does not redirect to external sites when provided a host field' do it 'does not redirect to external sites when provided a host field' do
...@@ -166,7 +166,7 @@ describe Projects::IssuesController do ...@@ -166,7 +166,7 @@ describe Projects::IssuesController do
get :new, namespace_id: project.namespace, project_id: project 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
end end
...@@ -174,7 +174,7 @@ describe Projects::IssuesController do ...@@ -174,7 +174,7 @@ describe Projects::IssuesController do
it 'renders the "new" template' do it 'renders the "new" template' do
get :new, namespace_id: project.namespace, project_id: project 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) expect(response).to render_template(:new)
end end
end end
...@@ -224,7 +224,7 @@ describe Projects::IssuesController do ...@@ -224,7 +224,7 @@ describe Projects::IssuesController do
it 'moves issue to another project' do it 'moves issue to another project' do
move_issue 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 expect(another_project.issues).not_to be_empty
end end
end end
...@@ -233,7 +233,7 @@ describe Projects::IssuesController do ...@@ -233,7 +233,7 @@ describe Projects::IssuesController do
it 'responds with 404' do it 'responds with 404' do
move_issue move_issue
expect(response).to have_http_status :not_found expect(response).to have_gitlab_http_status :not_found
end end
end end
...@@ -329,14 +329,14 @@ describe Projects::IssuesController do ...@@ -329,14 +329,14 @@ describe Projects::IssuesController do
sign_out(:user) sign_out(:user)
go(id: unescaped_parameter_value.to_param) 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 end
it 'returns 404 for non project members' do it 'returns 404 for non project members' do
sign_in(non_member) sign_in(non_member)
go(id: unescaped_parameter_value.to_param) 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 end
it 'returns 404 for project members with guest role' do it 'returns 404 for project members with guest role' do
...@@ -344,21 +344,21 @@ describe Projects::IssuesController do ...@@ -344,21 +344,21 @@ describe Projects::IssuesController do
project.team << [member, :guest] project.team << [member, :guest]
go(id: unescaped_parameter_value.to_param) 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 end
it "returns #{http_status[:success]} for author" do it "returns #{http_status[:success]} for author" do
sign_in(author) sign_in(author)
go(id: unescaped_parameter_value.to_param) 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
it "returns #{http_status[:success]} for assignee" do it "returns #{http_status[:success]} for assignee" do
sign_in(assignee) sign_in(assignee)
go(id: request_forgery_timing_attack.to_param) 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 end
it "returns #{http_status[:success]} for project members" do it "returns #{http_status[:success]} for project members" do
...@@ -366,14 +366,14 @@ describe Projects::IssuesController do ...@@ -366,14 +366,14 @@ describe Projects::IssuesController do
project.team << [member, :developer] project.team << [member, :developer]
go(id: unescaped_parameter_value.to_param) 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
it "returns #{http_status[:success]} for admin" do it "returns #{http_status[:success]} for admin" do
sign_in(admin) sign_in(admin)
go(id: unescaped_parameter_value.to_param) 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
end end
...@@ -475,7 +475,7 @@ describe Projects::IssuesController do ...@@ -475,7 +475,7 @@ describe Projects::IssuesController do
it 'returns 422 status' do it 'returns 422 status' do
update_issue update_issue
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
end end
...@@ -495,7 +495,7 @@ describe Projects::IssuesController do ...@@ -495,7 +495,7 @@ describe Projects::IssuesController do
end end
it 'returns 200 status' do it 'returns 200 status' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'accepts an issue after recaptcha is verified' do it 'accepts an issue after recaptcha is verified' do
...@@ -553,7 +553,7 @@ describe Projects::IssuesController do ...@@ -553,7 +553,7 @@ describe Projects::IssuesController do
it 'returns 200' do it 'returns 200' do
go(id: issue.iid) go(id: issue.iid)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -778,7 +778,7 @@ describe Projects::IssuesController do ...@@ -778,7 +778,7 @@ describe Projects::IssuesController do
it "rejects a developer to destroy an issue" do it "rejects a developer to destroy an issue" do
delete :destroy, namespace_id: project.namespace, project_id: project, id: issue.iid 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
end end
...@@ -794,7 +794,7 @@ describe Projects::IssuesController do ...@@ -794,7 +794,7 @@ describe Projects::IssuesController do
it "deletes the issue" do it "deletes the issue" do
delete :destroy, namespace_id: project.namespace, project_id: project, id: issue.iid 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\./) expect(controller).to set_flash[:notice].to(/The issue was successfully deleted\./)
end end
...@@ -818,7 +818,7 @@ describe Projects::IssuesController do ...@@ -818,7 +818,7 @@ describe Projects::IssuesController do
project_id: project, id: issue.iid, name: "thumbsup") project_id: project, id: issue.iid, name: "thumbsup")
end.to change { issue.award_emoji.count }.by(1) 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
end end
......
...@@ -20,7 +20,7 @@ describe Projects::JobsController do ...@@ -20,7 +20,7 @@ describe Projects::JobsController do
end end
it 'has only pending builds' do 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') expect(assigns(:builds).first.status).to eq('pending')
end end
end end
...@@ -33,7 +33,7 @@ describe Projects::JobsController do ...@@ -33,7 +33,7 @@ describe Projects::JobsController do
end end
it 'has only running jobs' do 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') expect(assigns(:builds).first.status).to eq('running')
end end
end end
...@@ -46,7 +46,7 @@ describe Projects::JobsController do ...@@ -46,7 +46,7 @@ describe Projects::JobsController do
end end
it 'has only finished jobs' do 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') expect(assigns(:builds).first.status).to eq('success')
end end
end end
...@@ -62,7 +62,7 @@ describe Projects::JobsController do ...@@ -62,7 +62,7 @@ describe Projects::JobsController do
end end
it 'redirects to the page' do 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) expect(assigns(:builds).current_page).to eq(last_page)
end end
end end
...@@ -107,7 +107,7 @@ describe Projects::JobsController do ...@@ -107,7 +107,7 @@ describe Projects::JobsController do
end end
it 'has a job' do 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) expect(assigns(:build).id).to eq(job.id)
end end
end end
...@@ -118,7 +118,7 @@ describe Projects::JobsController do ...@@ -118,7 +118,7 @@ describe Projects::JobsController do
end end
it 'renders not_found' do 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 end
end end
...@@ -136,7 +136,7 @@ describe Projects::JobsController do ...@@ -136,7 +136,7 @@ describe Projects::JobsController do
end end
it 'exposes needed information' do 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['raw_path']).to match(/jobs\/\d+\/raw\z/)
expect(json_response.dig('merge_request', 'path')).to match(/merge_requests\/\d+\z/) expect(json_response.dig('merge_request', 'path')).to match(/merge_requests\/\d+\z/)
expect(json_response['new_issue_path']) expect(json_response['new_issue_path'])
...@@ -163,7 +163,7 @@ describe Projects::JobsController do ...@@ -163,7 +163,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :trace, pipeline: pipeline) } let(:job) { create(:ci_build, :trace, pipeline: pipeline) }
it 'returns a trace' do 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['id']).to eq job.id
expect(json_response['status']).to eq job.status expect(json_response['status']).to eq job.status
expect(json_response['html']).to eq('BUILD TRACE') expect(json_response['html']).to eq('BUILD TRACE')
...@@ -174,7 +174,7 @@ describe Projects::JobsController do ...@@ -174,7 +174,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, pipeline: pipeline) } let(:job) { create(:ci_build, pipeline: pipeline) }
it 'returns no traces' do 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['id']).to eq job.id
expect(json_response['status']).to eq job.status expect(json_response['status']).to eq job.status
expect(json_response['html']).to be_nil expect(json_response['html']).to be_nil
...@@ -185,7 +185,7 @@ describe Projects::JobsController do ...@@ -185,7 +185,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :unicode_trace, pipeline: pipeline) } let(:job) { create(:ci_build, :unicode_trace, pipeline: pipeline) }
it 'returns a trace with Unicode' do 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['id']).to eq job.id
expect(json_response['status']).to eq job.status expect(json_response['status']).to eq job.status
expect(json_response['html']).to include("ヾ(´༎ຶД༎ຶ`)ノ") expect(json_response['html']).to include("ヾ(´༎ຶД༎ຶ`)ノ")
...@@ -212,7 +212,7 @@ describe Projects::JobsController do ...@@ -212,7 +212,7 @@ describe Projects::JobsController do
end end
it 'return a detailed job status in json' do 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['text']).to eq status.text
expect(json_response['label']).to eq status.label expect(json_response['label']).to eq status.label
expect(json_response['icon']).to eq status.icon expect(json_response['icon']).to eq status.icon
...@@ -232,7 +232,7 @@ describe Projects::JobsController do ...@@ -232,7 +232,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :retryable, pipeline: pipeline) } let(:job) { create(:ci_build, :retryable, pipeline: pipeline) }
it 'redirects to the retried job page' do 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)) expect(response).to redirect_to(namespace_project_job_path(id: Ci::Build.last.id))
end end
end end
...@@ -241,7 +241,7 @@ describe Projects::JobsController do ...@@ -241,7 +241,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, pipeline: pipeline) } let(:job) { create(:ci_build, pipeline: pipeline) }
it 'renders unprocessable_entity' do it 'renders unprocessable_entity' do
expect(response).to have_http_status(:unprocessable_entity) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
end end
...@@ -268,7 +268,7 @@ describe Projects::JobsController do ...@@ -268,7 +268,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :playable, pipeline: pipeline) } let(:job) { create(:ci_build, :playable, pipeline: pipeline) }
it 'redirects to the played job page' do 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)) expect(response).to redirect_to(namespace_project_job_path(id: job.id))
end end
...@@ -281,7 +281,7 @@ describe Projects::JobsController do ...@@ -281,7 +281,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, pipeline: pipeline) } let(:job) { create(:ci_build, pipeline: pipeline) }
it 'renders unprocessable_entity' do it 'renders unprocessable_entity' do
expect(response).to have_http_status(:unprocessable_entity) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
end end
...@@ -304,7 +304,7 @@ describe Projects::JobsController do ...@@ -304,7 +304,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :cancelable, pipeline: pipeline) } let(:job) { create(:ci_build, :cancelable, pipeline: pipeline) }
it 'redirects to the canceled job page' do 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)) expect(response).to redirect_to(namespace_project_job_path(id: job.id))
end end
...@@ -317,7 +317,7 @@ describe Projects::JobsController do ...@@ -317,7 +317,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :canceled, pipeline: pipeline) } let(:job) { create(:ci_build, :canceled, pipeline: pipeline) }
it 'returns unprocessable_entity' do it 'returns unprocessable_entity' do
expect(response).to have_http_status(:unprocessable_entity) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
end end
...@@ -342,7 +342,7 @@ describe Projects::JobsController do ...@@ -342,7 +342,7 @@ describe Projects::JobsController do
end end
it 'redirects to a index page' do 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) expect(response).to redirect_to(namespace_project_jobs_path)
end end
...@@ -359,7 +359,7 @@ describe Projects::JobsController do ...@@ -359,7 +359,7 @@ describe Projects::JobsController do
end end
it 'redirects to a index page' do 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) expect(response).to redirect_to(namespace_project_jobs_path)
end end
end end
...@@ -382,7 +382,7 @@ describe Projects::JobsController do ...@@ -382,7 +382,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :erasable, :trace, pipeline: pipeline) } let(:job) { create(:ci_build, :erasable, :trace, pipeline: pipeline) }
it 'redirects to the erased job page' do 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)) expect(response).to redirect_to(namespace_project_job_path(id: job.id))
end end
...@@ -400,7 +400,7 @@ describe Projects::JobsController do ...@@ -400,7 +400,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :erased, pipeline: pipeline) } let(:job) { create(:ci_build, :erased, pipeline: pipeline) }
it 'returns unprocessable_entity' do it 'returns unprocessable_entity' do
expect(response).to have_http_status(:unprocessable_entity) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
end end
...@@ -420,7 +420,7 @@ describe Projects::JobsController do ...@@ -420,7 +420,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, :trace, pipeline: pipeline) } let(:job) { create(:ci_build, :trace, pipeline: pipeline) }
it 'send a trace file' do 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.content_type).to eq 'text/plain; charset=utf-8'
expect(response.body).to eq 'BUILD TRACE' expect(response.body).to eq 'BUILD TRACE'
end end
...@@ -430,7 +430,7 @@ describe Projects::JobsController do ...@@ -430,7 +430,7 @@ describe Projects::JobsController do
let(:job) { create(:ci_build, pipeline: pipeline) } let(:job) { create(:ci_build, pipeline: pipeline) }
it 'returns not_found' do it 'returns not_found' do
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -78,7 +78,7 @@ describe Projects::LabelsController do ...@@ -78,7 +78,7 @@ describe Projects::LabelsController do
it 'creates labels' do it 'creates labels' do
post :generate, namespace_id: personal_project.namespace.to_param, project_id: personal_project 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
end end
...@@ -86,7 +86,7 @@ describe Projects::LabelsController do ...@@ -86,7 +86,7 @@ describe Projects::LabelsController do
it 'creates labels' do it 'creates labels' do
post :generate, namespace_id: project.namespace.to_param, project_id: project 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 end
end end
...@@ -97,7 +97,7 @@ describe Projects::LabelsController do ...@@ -97,7 +97,7 @@ describe Projects::LabelsController do
toggle_subscription(label) toggle_subscription(label)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'allows user to toggle subscription on group labels' do it 'allows user to toggle subscription on group labels' do
...@@ -105,7 +105,7 @@ describe Projects::LabelsController do ...@@ -105,7 +105,7 @@ describe Projects::LabelsController do
toggle_subscription(group_label) toggle_subscription(group_label)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
def toggle_subscription(label) def toggle_subscription(label)
...@@ -121,7 +121,7 @@ describe Projects::LabelsController do ...@@ -121,7 +121,7 @@ describe Projects::LabelsController do
it 'denies access' do it 'denies access' do
post :promote, namespace_id: project.namespace.to_param, project_id: project, id: label_1.to_param 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
end end
...@@ -170,7 +170,7 @@ describe Projects::LabelsController do ...@@ -170,7 +170,7 @@ describe Projects::LabelsController do
it 'does not redirect' do it 'does not redirect' do
get :index, namespace_id: project.namespace, project_id: project.to_param 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
end end
...@@ -203,13 +203,13 @@ describe Projects::LabelsController do ...@@ -203,13 +203,13 @@ describe Projects::LabelsController do
it 'does not 404' do it 'does not 404' do
post :generate, namespace_id: project.namespace, project_id: project 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 end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
post :generate, namespace_id: project.namespace, project_id: project 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
end end
...@@ -219,7 +219,7 @@ describe Projects::LabelsController do ...@@ -219,7 +219,7 @@ describe Projects::LabelsController do
it 'returns not found' do it 'returns not found' do
post :generate, namespace_id: project.namespace, project_id: project.to_param + 'old' 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 end
end end
......
...@@ -20,7 +20,7 @@ describe Projects::MattermostsController do ...@@ -20,7 +20,7 @@ describe Projects::MattermostsController do
namespace_id: project.namespace.to_param, namespace_id: project.namespace.to_param,
project_id: project) project_id: project)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
......
...@@ -28,7 +28,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -28,7 +28,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 200 status code' do it 'returns a 200 status code' do
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
it 'returns JSON with a message' do it 'returns JSON with a message' do
...@@ -116,7 +116,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -116,7 +116,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 404 status code' do 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
end end
...@@ -126,7 +126,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -126,7 +126,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 404 status code' do 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
end end
...@@ -138,7 +138,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -138,7 +138,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 200 status code' do it 'returns a 200 status code' do
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
it 'returns the file in JSON format' do it 'returns the file in JSON format' do
...@@ -198,7 +198,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -198,7 +198,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns an OK response' do it 'returns an OK response' do
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -224,7 +224,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -224,7 +224,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 400 error' do it 'returns a 400 error' do
expect(response).to have_http_status(:bad_request) expect(response).to have_gitlab_http_status(:bad_request)
end end
it 'has a message with the name of the first missing section' do it 'has a message with the name of the first missing section' do
...@@ -254,7 +254,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -254,7 +254,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 400 error' do it 'returns a 400 error' do
expect(response).to have_http_status(:bad_request) expect(response).to have_gitlab_http_status(:bad_request)
end end
it 'has a message with the name of the missing file' do it 'has a message with the name of the missing file' do
...@@ -292,7 +292,7 @@ describe Projects::MergeRequests::ConflictsController do ...@@ -292,7 +292,7 @@ describe Projects::MergeRequests::ConflictsController do
end end
it 'returns a 400 error' do it 'returns a 400 error' do
expect(response).to have_http_status(:bad_request) expect(response).to have_gitlab_http_status(:bad_request)
end end
it 'has a message with the path of the problem file' do it 'has a message with the path of the problem file' do
......
...@@ -112,7 +112,7 @@ describe Projects::MergeRequests::CreationsController do ...@@ -112,7 +112,7 @@ describe Projects::MergeRequests::CreationsController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -119,7 +119,7 @@ describe Projects::MergeRequests::DiffsController do ...@@ -119,7 +119,7 @@ describe Projects::MergeRequests::DiffsController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -131,7 +131,7 @@ describe Projects::MergeRequests::DiffsController do ...@@ -131,7 +131,7 @@ describe Projects::MergeRequests::DiffsController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -142,7 +142,7 @@ describe Projects::MergeRequests::DiffsController do ...@@ -142,7 +142,7 @@ describe Projects::MergeRequests::DiffsController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -155,7 +155,7 @@ describe Projects::MergeRequests::DiffsController do ...@@ -155,7 +155,7 @@ describe Projects::MergeRequests::DiffsController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -143,7 +143,7 @@ describe Projects::MergeRequestsController do ...@@ -143,7 +143,7 @@ describe Projects::MergeRequestsController do
get_merge_requests(last_page) get_merge_requests(last_page)
expect(assigns(:merge_requests).current_page).to eq(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 end
it 'does not redirect to external sites when provided a host field' do it 'does not redirect to external sites when provided a host field' do
...@@ -278,7 +278,7 @@ describe Projects::MergeRequestsController do ...@@ -278,7 +278,7 @@ describe Projects::MergeRequestsController do
end end
it 'returns 404' do it 'returns 404' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -434,7 +434,7 @@ describe Projects::MergeRequestsController do ...@@ -434,7 +434,7 @@ describe Projects::MergeRequestsController do
it "denies access to users unless they're admin or project owner" 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 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 end
context "when the user is owner" do context "when the user is owner" do
...@@ -449,7 +449,7 @@ describe Projects::MergeRequestsController do ...@@ -449,7 +449,7 @@ describe Projects::MergeRequestsController do
it "deletes the merge request" do it "deletes the merge request" do
delete :destroy, namespace_id: project.namespace, project_id: project, id: merge_request.iid 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\./) expect(controller).to set_flash[:notice].to(/The merge request was successfully deleted\./)
end end
...@@ -539,7 +539,7 @@ describe Projects::MergeRequestsController do ...@@ -539,7 +539,7 @@ describe Projects::MergeRequestsController do
subject subject
end end
it { is_expected.to have_http_status(:success) } it { is_expected.to have_gitlab_http_status(:success) }
it 'renders MergeRequest as JSON' do it 'renders MergeRequest as JSON' do
subject subject
...@@ -636,7 +636,7 @@ describe Projects::MergeRequestsController do ...@@ -636,7 +636,7 @@ describe Projects::MergeRequestsController do
end end
it 'return a detailed head_pipeline status in json' do 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['text']).to eq status.text
expect(json_response['label']).to eq status.label expect(json_response['label']).to eq status.label
expect(json_response['icon']).to eq status.icon expect(json_response['icon']).to eq status.icon
...@@ -650,7 +650,7 @@ describe Projects::MergeRequestsController do ...@@ -650,7 +650,7 @@ describe Projects::MergeRequestsController do
end end
it 'return empty' do 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 expect(json_response).to be_empty
end end
end end
......
...@@ -27,7 +27,7 @@ describe Projects::MilestonesController do ...@@ -27,7 +27,7 @@ describe Projects::MilestonesController do
it 'shows milestone page' do it 'shows milestone page' do
view_milestone view_milestone
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
......
...@@ -180,13 +180,13 @@ describe Projects::NotesController do ...@@ -180,13 +180,13 @@ describe Projects::NotesController do
it "returns status 302 for html" do it "returns status 302 for html" do
post :create, request_params post :create, request_params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
it "returns status 200 for json" do it "returns status 200 for json" do
post :create, request_params.merge(format: :json) post :create, request_params.merge(format: :json)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
context 'when merge_request_diff_head_sha present' do context 'when merge_request_diff_head_sha present' do
...@@ -205,7 +205,7 @@ describe Projects::NotesController do ...@@ -205,7 +205,7 @@ describe Projects::NotesController do
it "returns status 302 for html" do it "returns status 302 for html" do
post :create, request_params post :create, request_params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -240,7 +240,7 @@ describe Projects::NotesController do ...@@ -240,7 +240,7 @@ describe Projects::NotesController do
it 'returns a 404' do it 'returns a 404' do
post_create(note_project_id: Project.maximum(:id).succ) 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
end end
...@@ -248,7 +248,7 @@ describe Projects::NotesController do ...@@ -248,7 +248,7 @@ describe Projects::NotesController do
it 'returns a 404' do it 'returns a 404' do
post_create post_create
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -278,7 +278,7 @@ describe Projects::NotesController do ...@@ -278,7 +278,7 @@ describe Projects::NotesController do
request_params[:note][:noteable_id] = 9999 request_params[:note][:noteable_id] = 9999
post :create, request_params.merge(format: :json) post :create, request_params.merge(format: :json)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -286,13 +286,13 @@ describe Projects::NotesController do ...@@ -286,13 +286,13 @@ describe Projects::NotesController do
it 'returns 302 status for html' do it 'returns 302 status for html' do
post :create, request_params post :create, request_params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
it 'returns 200 status for json' do it 'returns 200 status for json' do
post :create, request_params.merge(format: :json) post :create, request_params.merge(format: :json)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'creates a new note' do it 'creates a new note' do
...@@ -308,7 +308,7 @@ describe Projects::NotesController do ...@@ -308,7 +308,7 @@ describe Projects::NotesController do
it 'returns 404 status' do it 'returns 404 status' do
post :create, request_params post :create, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'does not create a new note' do it 'does not create a new note' do
...@@ -337,7 +337,7 @@ describe Projects::NotesController do ...@@ -337,7 +337,7 @@ describe Projects::NotesController do
it "returns status 200 for html" do it "returns status 200 for html" do
delete :destroy, request_params delete :destroy, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it "deletes the note" do it "deletes the note" do
...@@ -354,7 +354,7 @@ describe Projects::NotesController do ...@@ -354,7 +354,7 @@ describe Projects::NotesController do
it "returns status 404" do it "returns status 404" do
delete :destroy, request_params delete :destroy, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -370,7 +370,7 @@ describe Projects::NotesController do ...@@ -370,7 +370,7 @@ describe Projects::NotesController do
post(:toggle_award_emoji, request_params.merge(name: "thumbsup")) post(:toggle_award_emoji, request_params.merge(name: "thumbsup"))
end.to change { note.award_emoji.count }.by(1) 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 end
it "removes the already awarded emoji" do it "removes the already awarded emoji" do
...@@ -380,7 +380,7 @@ describe Projects::NotesController do ...@@ -380,7 +380,7 @@ describe Projects::NotesController do
post(:toggle_award_emoji, request_params.merge(name: "thumbsup")) post(:toggle_award_emoji, request_params.merge(name: "thumbsup"))
end.to change { AwardEmoji.count }.by(-1) end.to change { AwardEmoji.count }.by(-1)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -398,7 +398,7 @@ describe Projects::NotesController do ...@@ -398,7 +398,7 @@ describe Projects::NotesController do
it "returns status 404" do it "returns status 404" do
post :resolve, request_params post :resolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -415,7 +415,7 @@ describe Projects::NotesController do ...@@ -415,7 +415,7 @@ describe Projects::NotesController do
it "returns status 404" do it "returns status 404" do
post :resolve, request_params post :resolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -442,7 +442,7 @@ describe Projects::NotesController do ...@@ -442,7 +442,7 @@ describe Projects::NotesController do
it "returns status 200" do it "returns status 200" do
post :resolve, request_params post :resolve, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -459,7 +459,7 @@ describe Projects::NotesController do ...@@ -459,7 +459,7 @@ describe Projects::NotesController do
it "returns status 404" do it "returns status 404" do
delete :unresolve, request_params delete :unresolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -476,7 +476,7 @@ describe Projects::NotesController do ...@@ -476,7 +476,7 @@ describe Projects::NotesController do
it "returns status 404" do it "returns status 404" do
delete :unresolve, request_params delete :unresolve, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -490,7 +490,7 @@ describe Projects::NotesController do ...@@ -490,7 +490,7 @@ describe Projects::NotesController do
it "returns status 200" do it "returns status 200" do
delete :unresolve, request_params delete :unresolve, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
......
...@@ -21,7 +21,7 @@ describe Projects::PagesController do ...@@ -21,7 +21,7 @@ describe Projects::PagesController do
it 'returns 200 status' do it 'returns 200 status' do
get :show, request_params get :show, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
context 'when the project is in a subgroup' do context 'when the project is in a subgroup' do
...@@ -31,7 +31,7 @@ describe Projects::PagesController do ...@@ -31,7 +31,7 @@ describe Projects::PagesController do
it 'returns a 404 status code' do it 'returns a 404 status code' do
get :show, request_params get :show, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -40,7 +40,7 @@ describe Projects::PagesController do ...@@ -40,7 +40,7 @@ describe Projects::PagesController do
it 'returns 302 status' do it 'returns 302 status' do
delete :destroy, request_params delete :destroy, request_params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -53,7 +53,7 @@ describe Projects::PagesController do ...@@ -53,7 +53,7 @@ describe Projects::PagesController do
it 'returns 404 status' do it 'returns 404 status' do
get :show, request_params get :show, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -61,7 +61,7 @@ describe Projects::PagesController do ...@@ -61,7 +61,7 @@ describe Projects::PagesController do
it 'returns 404 status' do it 'returns 404 status' do
delete :destroy, request_params delete :destroy, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -26,7 +26,7 @@ describe Projects::PagesDomainsController do ...@@ -26,7 +26,7 @@ describe Projects::PagesDomainsController do
it "displays the 'show' page" do it "displays the 'show' page" do
get(:show, request_params.merge(id: pages_domain.domain)) 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') expect(response).to render_template('show')
end end
end end
...@@ -35,7 +35,7 @@ describe Projects::PagesDomainsController do ...@@ -35,7 +35,7 @@ describe Projects::PagesDomainsController do
it "displays the 'new' page" do it "displays the 'new' page" do
get(:new, request_params) 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') expect(response).to render_template('new')
end end
end end
...@@ -69,7 +69,7 @@ describe Projects::PagesDomainsController do ...@@ -69,7 +69,7 @@ describe Projects::PagesDomainsController do
it 'returns 404 status' do it 'returns 404 status' do
get(:show, request_params.merge(id: pages_domain.domain)) 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
end end
...@@ -77,7 +77,7 @@ describe Projects::PagesDomainsController do ...@@ -77,7 +77,7 @@ describe Projects::PagesDomainsController do
it 'returns 404 status' do it 'returns 404 status' do
get :new, request_params get :new, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -85,7 +85,7 @@ describe Projects::PagesDomainsController do ...@@ -85,7 +85,7 @@ describe Projects::PagesDomainsController do
it "returns 404 status" do it "returns 404 status" do
post(:create, request_params.merge(pages_domain: pages_domain_params)) 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
end end
...@@ -93,7 +93,7 @@ describe Projects::PagesDomainsController do ...@@ -93,7 +93,7 @@ describe Projects::PagesDomainsController do
it "deletes the pages domain" do it "deletes the pages domain" do
delete(:destroy, request_params.merge(id: pages_domain.domain)) 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 end
end end
......
...@@ -15,7 +15,7 @@ describe Projects::PipelineSchedulesController do ...@@ -15,7 +15,7 @@ describe Projects::PipelineSchedulesController do
it 'renders the index view' do it 'renders the index view' do
visit_pipelines_schedules visit_pipelines_schedules
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index) expect(response).to render_template(:index)
end end
...@@ -35,7 +35,7 @@ describe Projects::PipelineSchedulesController do ...@@ -35,7 +35,7 @@ describe Projects::PipelineSchedulesController do
end end
it 'only shows active pipeline schedules' do 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)).to include(pipeline_schedule)
expect(assigns(:schedules)).not_to include(inactive_pipeline_schedule) expect(assigns(:schedules)).not_to include(inactive_pipeline_schedule)
end end
...@@ -57,7 +57,7 @@ describe Projects::PipelineSchedulesController do ...@@ -57,7 +57,7 @@ describe Projects::PipelineSchedulesController do
it 'initializes a pipeline schedule model' do it 'initializes a pipeline schedule model' do
get :new, namespace_id: project.namespace.to_param, project_id: project 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) expect(assigns(:schedule)).to be_a_new(Ci::PipelineSchedule)
end end
end end
...@@ -87,7 +87,7 @@ describe Projects::PipelineSchedulesController do ...@@ -87,7 +87,7 @@ describe Projects::PipelineSchedulesController do
.to change { Ci::PipelineSchedule.count }.by(1) .to change { Ci::PipelineSchedule.count }.by(1)
.and change { Ci::PipelineScheduleVariable.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| Ci::PipelineScheduleVariable.last.tap do |v|
expect(v.key).to eq("AAA") expect(v.key).to eq("AAA")
...@@ -158,7 +158,7 @@ describe Projects::PipelineSchedulesController do ...@@ -158,7 +158,7 @@ describe Projects::PipelineSchedulesController do
expect { go }.to change { Ci::PipelineScheduleVariable.count }.by(1) expect { go }.to change { Ci::PipelineScheduleVariable.count }.by(1)
pipeline_schedule.reload 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.key).to eq('AAA')
expect(pipeline_schedule.variables.last.value).to eq('AAA123') expect(pipeline_schedule.variables.last.value).to eq('AAA123')
end end
...@@ -324,7 +324,7 @@ describe Projects::PipelineSchedulesController do ...@@ -324,7 +324,7 @@ describe Projects::PipelineSchedulesController do
it 'loads the pipeline schedule' do it 'loads the pipeline schedule' do
get :edit, namespace_id: project.namespace.to_param, project_id: project, id: pipeline_schedule.id 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) expect(assigns(:schedule)).to eq(pipeline_schedule)
end end
end end
...@@ -376,7 +376,7 @@ describe Projects::PipelineSchedulesController do ...@@ -376,7 +376,7 @@ describe Projects::PipelineSchedulesController do
end end
it 'does not delete the pipeline schedule' do 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
end end
...@@ -391,7 +391,7 @@ describe Projects::PipelineSchedulesController do ...@@ -391,7 +391,7 @@ describe Projects::PipelineSchedulesController do
delete :destroy, namespace_id: project.namespace.to_param, project_id: project, id: pipeline_schedule.id delete :destroy, namespace_id: project.namespace.to_param, project_id: project, id: pipeline_schedule.id
end.to change { project.pipeline_schedules.count }.by(-1) 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 end
end end
......
...@@ -33,7 +33,7 @@ describe Projects::PipelinesController do ...@@ -33,7 +33,7 @@ describe Projects::PipelinesController do
it 'returns JSON with serialized pipelines' do it 'returns JSON with serialized pipelines' do
subject subject
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('pipeline') expect(response).to match_response_schema('pipeline')
expect(json_response).to include('pipelines') expect(json_response).to include('pipelines')
...@@ -57,7 +57,7 @@ describe Projects::PipelinesController do ...@@ -57,7 +57,7 @@ describe Projects::PipelinesController do
it 'returns the pipeline' do it 'returns the pipeline' do
get_pipeline_json 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).not_to be_an(Array)
expect(json_response['id']).to be(pipeline.id) expect(json_response['id']).to be(pipeline.id)
expect(json_response['details']).to have_key 'stages' expect(json_response['details']).to have_key 'stages'
...@@ -111,7 +111,7 @@ describe Projects::PipelinesController do ...@@ -111,7 +111,7 @@ describe Projects::PipelinesController do
end end
it 'returns html source for stage dropdown' do 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(response).to render_template('projects/pipelines/_stage')
expect(json_response).to include('html') expect(json_response).to include('html')
end end
...@@ -123,7 +123,7 @@ describe Projects::PipelinesController do ...@@ -123,7 +123,7 @@ describe Projects::PipelinesController do
end end
it 'responds with not found' do 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
end end
...@@ -148,7 +148,7 @@ describe Projects::PipelinesController do ...@@ -148,7 +148,7 @@ describe Projects::PipelinesController do
end end
it 'return a detailed pipeline status in json' do 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['text']).to eq status.text
expect(json_response['label']).to eq status.label expect(json_response['label']).to eq status.label
expect(json_response['icon']).to eq status.icon expect(json_response['icon']).to eq status.icon
...@@ -171,14 +171,14 @@ describe Projects::PipelinesController do ...@@ -171,14 +171,14 @@ describe Projects::PipelinesController do
let(:feature) { ProjectFeature::ENABLED } let(:feature) { ProjectFeature::ENABLED }
it 'retries a pipeline without returning any content' do 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 expect(build.reload).to be_retried
end end
end end
context 'when builds are disabled' do context 'when builds are disabled' do
it 'fails to retry pipeline' 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 end
end end
...@@ -198,14 +198,14 @@ describe Projects::PipelinesController do ...@@ -198,14 +198,14 @@ describe Projects::PipelinesController do
let(:feature) { ProjectFeature::ENABLED } let(:feature) { ProjectFeature::ENABLED }
it 'cancels a pipeline without returning any content' do 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 expect(pipeline.reload).to be_canceled
end end
end end
context 'when builds are disabled' do context 'when builds are disabled' do
it 'fails to retry pipeline' 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 end
end end
......
...@@ -25,7 +25,7 @@ describe Projects::PipelinesSettingsController do ...@@ -25,7 +25,7 @@ describe Projects::PipelinesSettingsController do
let(:params) { { enabled: '', domain: 'mepmep.md' } } let(:params) { { enabled: '', domain: 'mepmep.md' } }
it 'redirects to the settings page' do 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.") expect(flash[:notice]).to eq("Pipelines settings for '#{project.name}' were successfully updated.")
end end
......
...@@ -8,7 +8,7 @@ describe Projects::ProjectMembersController do ...@@ -8,7 +8,7 @@ describe Projects::ProjectMembersController do
it 'should have the project_members address with a 200 status code' do it 'should have the project_members address with a 200 status code' do
get :index, namespace_id: project.namespace, project_id: project 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
end end
...@@ -30,7 +30,7 @@ describe Projects::ProjectMembersController do ...@@ -30,7 +30,7 @@ describe Projects::ProjectMembersController do
user_ids: project_user.id, user_ids: project_user.id,
access_level: Gitlab::Access::GUEST 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 expect(project.users).not_to include project_user
end end
end end
...@@ -79,7 +79,7 @@ describe Projects::ProjectMembersController do ...@@ -79,7 +79,7 @@ describe Projects::ProjectMembersController do
project_id: project, project_id: project,
id: 42 id: 42
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -94,7 +94,7 @@ describe Projects::ProjectMembersController do ...@@ -94,7 +94,7 @@ describe Projects::ProjectMembersController do
project_id: project, project_id: project,
id: member id: member
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
expect(project.members).to include member expect(project.members).to include member
end end
end end
...@@ -137,7 +137,7 @@ describe Projects::ProjectMembersController do ...@@ -137,7 +137,7 @@ describe Projects::ProjectMembersController do
delete :leave, namespace_id: project.namespace, delete :leave, namespace_id: project.namespace,
project_id: project project_id: project
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -168,7 +168,7 @@ describe Projects::ProjectMembersController do ...@@ -168,7 +168,7 @@ describe Projects::ProjectMembersController do
delete :leave, namespace_id: project.namespace, delete :leave, namespace_id: project.namespace,
project_id: project project_id: project
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -221,7 +221,7 @@ describe Projects::ProjectMembersController do ...@@ -221,7 +221,7 @@ describe Projects::ProjectMembersController do
project_id: project, project_id: project,
id: 42 id: 42
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -236,7 +236,7 @@ describe Projects::ProjectMembersController do ...@@ -236,7 +236,7 @@ describe Projects::ProjectMembersController do
project_id: project, project_id: project,
id: member id: member
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
expect(project.members).not_to include member expect(project.members).not_to include member
end end
end end
......
...@@ -24,7 +24,7 @@ describe Projects::PrometheusController do ...@@ -24,7 +24,7 @@ describe Projects::PrometheusController do
it 'returns no content response' do it 'returns no content response' do
get :active_metrics, project_params(format: :json) get :active_metrics, project_params(format: :json)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end end
end end
...@@ -38,7 +38,7 @@ describe Projects::PrometheusController do ...@@ -38,7 +38,7 @@ describe Projects::PrometheusController do
it 'returns no content response' do it 'returns no content response' do
get :active_metrics, project_params(format: :json) 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) expect(json_response).to eq(sample_response.deep_stringify_keys)
end end
end end
...@@ -47,7 +47,7 @@ describe Projects::PrometheusController do ...@@ -47,7 +47,7 @@ describe Projects::PrometheusController do
it 'returns not found response' do it 'returns not found response' do
get :active_metrics, project_params get :active_metrics, project_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -13,7 +13,7 @@ describe Projects::RawController do ...@@ -13,7 +13,7 @@ describe Projects::RawController do
project_id: public_project, project_id: public_project,
id: id) 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-Type']).to eq('text/plain; charset=utf-8')
expect(response.header['Content-Disposition']) expect(response.header['Content-Disposition'])
.to eq('inline') .to eq('inline')
...@@ -30,7 +30,7 @@ describe Projects::RawController do ...@@ -30,7 +30,7 @@ describe Projects::RawController do
project_id: public_project, project_id: public_project,
id: id) 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['Content-Type']).to eq('image/jpeg')
expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with('git-blob:') expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with('git-blob:')
end end
...@@ -59,7 +59,7 @@ describe Projects::RawController do ...@@ -59,7 +59,7 @@ describe Projects::RawController do
project_id: public_project, project_id: public_project,
id: id) id: id)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -70,7 +70,7 @@ describe Projects::RawController do ...@@ -70,7 +70,7 @@ describe Projects::RawController do
project_id: public_project, project_id: public_project,
id: id) id: id)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -86,7 +86,7 @@ describe Projects::RawController do ...@@ -86,7 +86,7 @@ describe Projects::RawController do
project_id: public_project, project_id: public_project,
id: id) 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-Type']).to eq('text/plain; charset=utf-8')
expect(response.header['Content-Disposition']) expect(response.header['Content-Disposition'])
.to eq('inline') .to eq('inline')
......
...@@ -35,7 +35,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -35,7 +35,7 @@ describe Projects::Registry::RepositoriesController do
it 'successfully renders container repositories' do it 'successfully renders container repositories' do
go_to_index go_to_index
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
it 'creates a root container repository' do it 'creates a root container repository' do
...@@ -46,7 +46,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -46,7 +46,7 @@ describe Projects::Registry::RepositoriesController do
it 'json has a list of projects' do it 'json has a list of projects' do
go_to_index(format: :json) 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') expect(response).to match_response_schema('registry/repositories')
end end
end end
...@@ -59,7 +59,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -59,7 +59,7 @@ describe Projects::Registry::RepositoriesController do
it 'successfully renders container repositories' do it 'successfully renders container repositories' do
go_to_index go_to_index
expect(response).to have_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
end end
it 'does not ensure root container repository' do it 'does not ensure root container repository' do
...@@ -69,7 +69,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -69,7 +69,7 @@ describe Projects::Registry::RepositoriesController do
it 'responds with json if asked' do it 'responds with json if asked' do
go_to_index(format: :json) 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) expect(json_response).to be_kind_of(Array)
end end
end end
...@@ -89,7 +89,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -89,7 +89,7 @@ describe Projects::Registry::RepositoriesController do
it 'deletes a repository' do it 'deletes a repository' do
expect { delete_repository(repository) }.to change { ContainerRepository.all.count }.by(-1) 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 end
end end
...@@ -100,7 +100,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -100,7 +100,7 @@ describe Projects::Registry::RepositoriesController do
it 'responds with 404' do it 'responds with 404' do
go_to_index go_to_index
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
it 'does not ensure root container repository' do it 'does not ensure root container repository' do
......
...@@ -30,7 +30,7 @@ describe Projects::Registry::TagsController do ...@@ -30,7 +30,7 @@ describe Projects::Registry::TagsController do
it 'receive a list of tags' do it 'receive a list of tags' do
get_tags 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 match_response_schema('registry/tags')
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
end end
...@@ -44,7 +44,7 @@ describe Projects::Registry::TagsController do ...@@ -44,7 +44,7 @@ describe Projects::Registry::TagsController do
it 'receive a list of tags' do it 'receive a list of tags' do
get_tags 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 match_response_schema('registry/tags')
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
end end
...@@ -58,7 +58,7 @@ describe Projects::Registry::TagsController do ...@@ -58,7 +58,7 @@ describe Projects::Registry::TagsController do
it 'does not receive a list of tags' do it 'does not receive a list of tags' do
get_tags get_tags
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -35,7 +35,7 @@ describe Projects::RepositoriesController do ...@@ -35,7 +35,7 @@ describe Projects::RepositoriesController do
it "renders Not Found" do it "renders Not Found" do
get :archive, namespace_id: project.namespace, project_id: project, ref: "master", format: "zip" 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 end
end end
......
...@@ -29,7 +29,7 @@ describe Projects::RunnersController do ...@@ -29,7 +29,7 @@ describe Projects::RunnersController do
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(runner.description).to eq(new_desc) expect(runner.description).to eq(new_desc)
end end
end end
...@@ -38,7 +38,7 @@ describe Projects::RunnersController do ...@@ -38,7 +38,7 @@ describe Projects::RunnersController do
it 'destroys the runner' do it 'destroys the runner' do
delete :destroy, params 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 expect(Ci::Runner.find_by(id: runner.id)).to be_nil
end end
end end
...@@ -53,7 +53,7 @@ describe Projects::RunnersController do ...@@ -53,7 +53,7 @@ describe Projects::RunnersController do
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(runner.active).to eq(true) expect(runner.active).to eq(true)
end end
end end
...@@ -68,7 +68,7 @@ describe Projects::RunnersController do ...@@ -68,7 +68,7 @@ describe Projects::RunnersController do
runner.reload runner.reload
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(runner.active).to eq(false) expect(runner.active).to eq(false)
end end
end end
......
...@@ -19,7 +19,7 @@ describe Projects::ServicesController do ...@@ -19,7 +19,7 @@ describe Projects::ServicesController do
put :test, namespace_id: project.namespace, project_id: project, id: service.to_param 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
end end
......
...@@ -13,7 +13,7 @@ describe Projects::Settings::CiCdController do ...@@ -13,7 +13,7 @@ describe Projects::Settings::CiCdController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, namespace_id: project.namespace, project_id: project 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) expect(response).to render_template(:show)
end end
end end
......
...@@ -13,7 +13,7 @@ describe Projects::Settings::IntegrationsController do ...@@ -13,7 +13,7 @@ describe Projects::Settings::IntegrationsController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, namespace_id: project.namespace, project_id: project 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) expect(response).to render_template(:show)
end end
end end
......
...@@ -13,7 +13,7 @@ describe Projects::Settings::RepositoryController do ...@@ -13,7 +13,7 @@ describe Projects::Settings::RepositoryController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, namespace_id: project.namespace, project_id: project 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) expect(response).to render_template(:show)
end end
end end
......
...@@ -29,7 +29,7 @@ describe Projects::SnippetsController do ...@@ -29,7 +29,7 @@ describe Projects::SnippetsController do
project_id: project, page: last_page.to_param project_id: project, page: last_page.to_param
expect(assigns(:snippets).current_page).to eq(last_page) 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
end end
...@@ -41,7 +41,7 @@ describe Projects::SnippetsController do ...@@ -41,7 +41,7 @@ describe Projects::SnippetsController do
get :index, namespace_id: project.namespace, project_id: project get :index, namespace_id: project.namespace, project_id: project
expect(assigns(:snippets)).not_to include(project_snippet) 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
end end
...@@ -54,7 +54,7 @@ describe Projects::SnippetsController do ...@@ -54,7 +54,7 @@ describe Projects::SnippetsController do
get :index, namespace_id: project.namespace, project_id: project get :index, namespace_id: project.namespace, project_id: project
expect(assigns(:snippets)).to include(project_snippet) 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 end
...@@ -67,7 +67,7 @@ describe Projects::SnippetsController do ...@@ -67,7 +67,7 @@ describe Projects::SnippetsController do
get :index, namespace_id: project.namespace, project_id: project get :index, namespace_id: project.namespace, project_id: project
expect(assigns(:snippets)).to include(project_snippet) 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 end
end end
...@@ -316,7 +316,7 @@ describe Projects::SnippetsController do ...@@ -316,7 +316,7 @@ describe Projects::SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param 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
end end
...@@ -329,7 +329,7 @@ describe Projects::SnippetsController do ...@@ -329,7 +329,7 @@ describe Projects::SnippetsController do
get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param
expect(assigns(:snippet)).to eq(project_snippet) 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 end
...@@ -342,7 +342,7 @@ describe Projects::SnippetsController do ...@@ -342,7 +342,7 @@ describe Projects::SnippetsController do
get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param get action, namespace_id: project.namespace, project_id: project, id: project_snippet.to_param
expect(assigns(:snippet)).to eq(project_snippet) 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 end
end end
...@@ -352,7 +352,7 @@ describe Projects::SnippetsController do ...@@ -352,7 +352,7 @@ describe Projects::SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get action, namespace_id: project.namespace, project_id: project, id: 42 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 end
...@@ -364,7 +364,7 @@ describe Projects::SnippetsController do ...@@ -364,7 +364,7 @@ describe Projects::SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get action, namespace_id: project.namespace, project_id: project, id: 42 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 end
end end
......
...@@ -28,13 +28,13 @@ describe Projects::TodosController do ...@@ -28,13 +28,13 @@ describe Projects::TodosController do
go go
end.to change { user.todos.count }.by(1) end.to change { user.todos.count }.by(1)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'returns todo path and pending count' do it 'returns todo path and pending count' do
go 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['count']).to eq 1
expect(json_response['delete_path']).to match(/\/dashboard\/todos\/\d{1}/) expect(json_response['delete_path']).to match(/\/dashboard\/todos\/\d{1}/)
end end
...@@ -47,7 +47,7 @@ describe Projects::TodosController do ...@@ -47,7 +47,7 @@ describe Projects::TodosController do
go go
end.to change { user.todos.count }.by(0) end.to change { user.todos.count }.by(0)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'does not create todo for issue when user not logged in' do it 'does not create todo for issue when user not logged in' do
...@@ -55,7 +55,7 @@ describe Projects::TodosController do ...@@ -55,7 +55,7 @@ describe Projects::TodosController do
go go
end.to change { user.todos.count }.by(0) 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
end end
...@@ -68,7 +68,7 @@ describe Projects::TodosController do ...@@ -68,7 +68,7 @@ describe Projects::TodosController do
it "doesn't create todo" do it "doesn't create todo" do
expect { go }.not_to change { user.todos.count } 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 end
end end
...@@ -96,13 +96,13 @@ describe Projects::TodosController do ...@@ -96,13 +96,13 @@ describe Projects::TodosController do
go go
end.to change { user.todos.count }.by(1) end.to change { user.todos.count }.by(1)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'returns todo path and pending count' do it 'returns todo path and pending count' do
go 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['count']).to eq 1
expect(json_response['delete_path']).to match(/\/dashboard\/todos\/\d{1}/) expect(json_response['delete_path']).to match(/\/dashboard\/todos\/\d{1}/)
end end
...@@ -115,7 +115,7 @@ describe Projects::TodosController do ...@@ -115,7 +115,7 @@ describe Projects::TodosController do
go go
end.to change { user.todos.count }.by(0) end.to change { user.todos.count }.by(0)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'does not create todo for merge request user has no access to' do it 'does not create todo for merge request user has no access to' do
...@@ -123,7 +123,7 @@ describe Projects::TodosController do ...@@ -123,7 +123,7 @@ describe Projects::TodosController do
go go
end.to change { user.todos.count }.by(0) 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
end end
...@@ -136,7 +136,7 @@ describe Projects::TodosController do ...@@ -136,7 +136,7 @@ describe Projects::TodosController do
it "doesn't create todo" do it "doesn't create todo" do
expect { go }.not_to change { user.todos.count } 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 end
end end
......
...@@ -64,7 +64,7 @@ describe Projects::TreeController do ...@@ -64,7 +64,7 @@ describe Projects::TreeController do
context "valid SHA commit ID with path" do context "valid SHA commit ID with path" do
let(:id) { '6d39438/.gitignore' } let(:id) { '6d39438/.gitignore' }
it { expect(response).to have_http_status(302) } it { expect(response).to have_gitlab_http_status(302) }
end end
end end
......
...@@ -18,7 +18,7 @@ describe Projects::UploadsController do ...@@ -18,7 +18,7 @@ describe Projects::UploadsController do
namespace_id: project.namespace.to_param, namespace_id: project.namespace.to_param,
project_id: project, project_id: project,
format: :json format: :json
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
end end
...@@ -90,7 +90,7 @@ describe Projects::UploadsController do ...@@ -90,7 +90,7 @@ describe Projects::UploadsController do
it "responds with status 200" do it "responds with status 200" do
go go
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -98,7 +98,7 @@ describe Projects::UploadsController do ...@@ -98,7 +98,7 @@ describe Projects::UploadsController do
it "responds with status 404" do it "responds with status 404" do
go go
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -117,7 +117,7 @@ describe Projects::UploadsController do ...@@ -117,7 +117,7 @@ describe Projects::UploadsController do
it "responds with status 200" do it "responds with status 200" do
go go
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -125,7 +125,7 @@ describe Projects::UploadsController do ...@@ -125,7 +125,7 @@ describe Projects::UploadsController do
it "responds with status 404" do it "responds with status 404" do
go go
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -151,7 +151,7 @@ describe Projects::UploadsController do ...@@ -151,7 +151,7 @@ describe Projects::UploadsController do
it "responds with status 200" do it "responds with status 200" do
go go
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -192,7 +192,7 @@ describe Projects::UploadsController do ...@@ -192,7 +192,7 @@ describe Projects::UploadsController do
it "responds with status 200" do it "responds with status 200" do
go go
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -200,7 +200,7 @@ describe Projects::UploadsController do ...@@ -200,7 +200,7 @@ describe Projects::UploadsController do
it "responds with status 404" do it "responds with status 404" do
go go
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -220,7 +220,7 @@ describe Projects::UploadsController do ...@@ -220,7 +220,7 @@ describe Projects::UploadsController do
it "responds with status 200" do it "responds with status 200" do
go go
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -228,7 +228,7 @@ describe Projects::UploadsController do ...@@ -228,7 +228,7 @@ describe Projects::UploadsController do
it "responds with status 404" do it "responds with status 404" do
go go
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -237,7 +237,7 @@ describe Projects::UploadsController do ...@@ -237,7 +237,7 @@ describe Projects::UploadsController do
it "responds with status 404" do it "responds with status 404" do
go go
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -50,7 +50,7 @@ describe Projects::VariablesController do ...@@ -50,7 +50,7 @@ describe Projects::VariablesController do
post :update, namespace_id: project.namespace.to_param, project_id: project, post :update, namespace_id: project.namespace.to_param, project_id: project,
id: variable.id, variable: { key: '?', value: variable.value } 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 expect(response).to render_template :show
end end
end end
......
...@@ -24,7 +24,7 @@ describe ProjectsController do ...@@ -24,7 +24,7 @@ describe ProjectsController do
get :new, namespace_id: group.id get :new, namespace_id: group.id
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('new') expect(response).to render_template('new')
end end
end end
...@@ -33,7 +33,7 @@ describe ProjectsController do ...@@ -33,7 +33,7 @@ describe ProjectsController do
it 'responds with status 404' do it 'responds with status 404' do
get :new, namespace_id: group.id get :new, namespace_id: group.id
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
expect(response).not_to render_template('new') expect(response).not_to render_template('new')
end end
end end
...@@ -152,7 +152,7 @@ describe ProjectsController do ...@@ -152,7 +152,7 @@ describe ProjectsController do
it 'renders a 503' do it 'renders a 503' do
get :show, namespace_id: project.namespace, id: project get :show, namespace_id: project.namespace, id: project
expect(response).to have_http_status(503) expect(response).to have_gitlab_http_status(503)
end end
end end
...@@ -257,7 +257,7 @@ describe ProjectsController do ...@@ -257,7 +257,7 @@ describe ProjectsController do
get :show, namespace_id: project.namespace, id: project, format: :git get :show, namespace_id: project.namespace, id: project, format: :git
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to(namespace_project_path) expect(response).to redirect_to(namespace_project_path)
end end
end end
...@@ -280,7 +280,7 @@ describe ProjectsController do ...@@ -280,7 +280,7 @@ describe ProjectsController do
expect(project.path).to include 'renamed_path' expect(project.path).to include 'renamed_path'
expect(assigns(:repository).path).to include project.path expect(assigns(:repository).path).to include project.path
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -296,7 +296,7 @@ describe ProjectsController do ...@@ -296,7 +296,7 @@ describe ProjectsController do
.not_to change { project.reload.path } .not_to change { project.reload.path }
expect(controller).to set_flash[:alert].to(/container registry tags/) expect(controller).to set_flash[:alert].to(/container registry tags/)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -312,7 +312,7 @@ describe ProjectsController do ...@@ -312,7 +312,7 @@ describe ProjectsController do
id: project.id, id: project.id,
project: params project: params
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
params.each do |param, value| params.each do |param, value|
expect(project.public_send(param)).to eq(value) expect(project.public_send(param)).to eq(value)
end end
...@@ -345,7 +345,7 @@ describe ProjectsController do ...@@ -345,7 +345,7 @@ describe ProjectsController do
project.reload project.reload
expect(project.namespace).to eq(new_namespace) expect(project.namespace).to eq(new_namespace)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
context 'when new namespace is empty' do context 'when new namespace is empty' do
...@@ -364,7 +364,7 @@ describe ProjectsController do ...@@ -364,7 +364,7 @@ describe ProjectsController do
project.reload project.reload
expect(project.namespace).to eq(old_namespace) expect(project.namespace).to eq(old_namespace)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(flash[:alert]).to eq 'Please select a new namespace for your project.' expect(flash[:alert]).to eq 'Please select a new namespace for your project.'
end end
end end
...@@ -381,7 +381,7 @@ describe ProjectsController do ...@@ -381,7 +381,7 @@ describe ProjectsController do
delete :destroy, namespace_id: project.namespace, id: project delete :destroy, namespace_id: project.namespace, id: project
expect { Project.find(orig_id) }.to raise_error(ActiveRecord::RecordNotFound) expect { Project.find(orig_id) }.to raise_error(ActiveRecord::RecordNotFound)
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to(dashboard_projects_path) expect(response).to redirect_to(dashboard_projects_path)
end end
...@@ -420,7 +420,7 @@ describe ProjectsController do ...@@ -420,7 +420,7 @@ describe ProjectsController do
end end
it 'has http status 200' do it 'has http status 200' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'changes the user incoming email token' do it 'changes the user incoming email token' do
...@@ -496,7 +496,7 @@ describe ProjectsController do ...@@ -496,7 +496,7 @@ describe ProjectsController do
delete(:remove_fork, delete(:remove_fork,
namespace_id: project.namespace, namespace_id: project.namespace,
id: project, format: :js) id: project, format: :js)
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
...@@ -544,7 +544,7 @@ describe ProjectsController do ...@@ -544,7 +544,7 @@ describe ProjectsController do
get :show, namespace_id: public_project.namespace, id: public_project get :show, namespace_id: public_project.namespace, id: public_project
expect(assigns(:project)).to eq(public_project) expect(assigns(:project)).to eq(public_project)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -583,13 +583,13 @@ describe ProjectsController do ...@@ -583,13 +583,13 @@ describe ProjectsController do
it 'does not 404' do it 'does not 404' do
post :toggle_star, namespace_id: public_project.namespace, id: public_project.path.upcase post :toggle_star, namespace_id: public_project.namespace, id: public_project.path.upcase
expect(response).not_to have_http_status(404) expect(response).not_to have_gitlab_http_status(404)
end end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
post :toggle_star, namespace_id: public_project.namespace, id: public_project.path.upcase post :toggle_star, namespace_id: public_project.namespace, id: public_project.path.upcase
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -599,7 +599,7 @@ describe ProjectsController do ...@@ -599,7 +599,7 @@ describe ProjectsController do
it 'returns not found' do it 'returns not found' do
post :toggle_star, namespace_id: 'foo', id: 'bar' post :toggle_star, namespace_id: 'foo', id: 'bar'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -613,13 +613,13 @@ describe ProjectsController do ...@@ -613,13 +613,13 @@ describe ProjectsController do
it 'does not 404' do it 'does not 404' do
delete :destroy, namespace_id: project.namespace, id: project.path.upcase delete :destroy, namespace_id: project.namespace, id: project.path.upcase
expect(response).not_to have_http_status(404) expect(response).not_to have_gitlab_http_status(404)
end end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
delete :destroy, namespace_id: project.namespace, id: project.path.upcase delete :destroy, namespace_id: project.namespace, id: project.path.upcase
expect(response).not_to have_http_status(301) expect(response).not_to have_gitlab_http_status(301)
end end
end end
...@@ -629,7 +629,7 @@ describe ProjectsController do ...@@ -629,7 +629,7 @@ describe ProjectsController do
it 'returns not found' do it 'returns not found' do
delete :destroy, namespace_id: 'foo', id: 'bar' delete :destroy, namespace_id: 'foo', id: 'bar'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -646,7 +646,7 @@ describe ProjectsController do ...@@ -646,7 +646,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
get :export, namespace_id: project.namespace, id: project get :export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -658,7 +658,7 @@ describe ProjectsController do ...@@ -658,7 +658,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
get :export, namespace_id: project.namespace, id: project get :export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -674,7 +674,7 @@ describe ProjectsController do ...@@ -674,7 +674,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
get :download_export, namespace_id: project.namespace, id: project get :download_export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -686,7 +686,7 @@ describe ProjectsController do ...@@ -686,7 +686,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
get :download_export, namespace_id: project.namespace, id: project get :download_export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -702,7 +702,7 @@ describe ProjectsController do ...@@ -702,7 +702,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
post :remove_export, namespace_id: project.namespace, id: project post :remove_export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -714,7 +714,7 @@ describe ProjectsController do ...@@ -714,7 +714,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
post :remove_export, namespace_id: project.namespace, id: project post :remove_export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -730,7 +730,7 @@ describe ProjectsController do ...@@ -730,7 +730,7 @@ describe ProjectsController do
it 'returns 302' do it 'returns 302' do
post :generate_new_export, namespace_id: project.namespace, id: project post :generate_new_export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
end end
end end
...@@ -742,7 +742,7 @@ describe ProjectsController do ...@@ -742,7 +742,7 @@ describe ProjectsController do
it 'returns 404' do it 'returns 404' do
post :generate_new_export, namespace_id: project.namespace, id: project post :generate_new_export, namespace_id: project.namespace, id: project
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -69,7 +69,7 @@ describe SentNotificationsController do ...@@ -69,7 +69,7 @@ describe SentNotificationsController do
end end
it 'returns a 404' do it 'returns a 404' do
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -19,7 +19,7 @@ describe SessionsController do ...@@ -19,7 +19,7 @@ describe SessionsController do
it 'redirects to :omniauth_authorize_path' do it 'redirects to :omniauth_authorize_path' do
get(:new) get(:new)
expect(response).to have_http_status(302) expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to('/saml') expect(response).to redirect_to('/saml')
end end
end end
...@@ -28,7 +28,7 @@ describe SessionsController do ...@@ -28,7 +28,7 @@ describe SessionsController do
it 'responds with 200' do it 'responds with 200' do
get(:new, auto_sign_in: 'false') get(:new, auto_sign_in: 'false')
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
......
...@@ -20,7 +20,7 @@ describe Snippets::NotesController do ...@@ -20,7 +20,7 @@ describe Snippets::NotesController do
end end
it "returns status 200" do it "returns status 200" do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it "returns not empty array of notes" do it "returns not empty array of notes" do
...@@ -37,7 +37,7 @@ describe Snippets::NotesController do ...@@ -37,7 +37,7 @@ describe Snippets::NotesController do
it "returns status 404" do it "returns status 404" do
get :index, { snippet_id: internal_snippet } get :index, { snippet_id: internal_snippet }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -49,7 +49,7 @@ describe Snippets::NotesController do ...@@ -49,7 +49,7 @@ describe Snippets::NotesController do
it "returns status 200" do it "returns status 200" do
get :index, { snippet_id: internal_snippet } get :index, { snippet_id: internal_snippet }
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -63,7 +63,7 @@ describe Snippets::NotesController do ...@@ -63,7 +63,7 @@ describe Snippets::NotesController do
it "returns status 404" do it "returns status 404" do
get :index, { snippet_id: private_snippet } get :index, { snippet_id: private_snippet }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -75,7 +75,7 @@ describe Snippets::NotesController do ...@@ -75,7 +75,7 @@ describe Snippets::NotesController do
it "returns status 404" do it "returns status 404" do
get :index, { snippet_id: private_snippet } get :index, { snippet_id: private_snippet }
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -89,7 +89,7 @@ describe Snippets::NotesController do ...@@ -89,7 +89,7 @@ describe Snippets::NotesController do
it "returns status 200" do it "returns status 200" do
get :index, { snippet_id: private_snippet } get :index, { snippet_id: private_snippet }
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it "returns 1 note" do it "returns 1 note" do
...@@ -134,7 +134,7 @@ describe Snippets::NotesController do ...@@ -134,7 +134,7 @@ describe Snippets::NotesController do
it "returns status 200" do it "returns status 200" do
delete :destroy, request_params delete :destroy, request_params
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it "deletes the note" do it "deletes the note" do
...@@ -162,7 +162,7 @@ describe Snippets::NotesController do ...@@ -162,7 +162,7 @@ describe Snippets::NotesController do
it "returns status 404" do it "returns status 404" do
delete :destroy, request_params delete :destroy, request_params
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it "does not update the note" do it "does not update the note" do
...@@ -182,7 +182,7 @@ describe Snippets::NotesController do ...@@ -182,7 +182,7 @@ describe Snippets::NotesController do
it "toggles the award emoji" do it "toggles the award emoji" do
expect { subject }.to change { note.award_emoji.count }.by(1) expect { subject }.to change { note.award_emoji.count }.by(1)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it "removes the already awarded emoji when it exists" do it "removes the already awarded emoji when it exists" do
...@@ -190,7 +190,7 @@ describe Snippets::NotesController do ...@@ -190,7 +190,7 @@ describe Snippets::NotesController do
expect { subject }.to change { AwardEmoji.count }.by(-1) expect { subject }.to change { AwardEmoji.count }.by(-1)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -40,7 +40,7 @@ describe SnippetsController do ...@@ -40,7 +40,7 @@ describe SnippetsController do
it 'responds with status 200' do it 'responds with status 200' do
get :new get :new
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -69,7 +69,7 @@ describe SnippetsController do ...@@ -69,7 +69,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :show, id: other_personal_snippet.to_param get :show, id: other_personal_snippet.to_param
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -78,7 +78,7 @@ describe SnippetsController do ...@@ -78,7 +78,7 @@ describe SnippetsController do
get :show, id: personal_snippet.to_param get :show, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -104,7 +104,7 @@ describe SnippetsController do ...@@ -104,7 +104,7 @@ describe SnippetsController do
get :show, id: personal_snippet.to_param get :show, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -129,7 +129,7 @@ describe SnippetsController do ...@@ -129,7 +129,7 @@ describe SnippetsController do
get :show, id: personal_snippet.to_param get :show, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -138,7 +138,7 @@ describe SnippetsController do ...@@ -138,7 +138,7 @@ describe SnippetsController do
get :show, id: personal_snippet.to_param get :show, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -152,7 +152,7 @@ describe SnippetsController do ...@@ -152,7 +152,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :show, id: 'doesntexist' get :show, id: 'doesntexist'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -432,7 +432,7 @@ describe SnippetsController do ...@@ -432,7 +432,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :raw, id: other_personal_snippet.to_param get :raw, id: other_personal_snippet.to_param
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -443,7 +443,7 @@ describe SnippetsController do ...@@ -443,7 +443,7 @@ describe SnippetsController do
it 'responds with status 200' do it 'responds with status 200' do
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'has expected headers' do it 'has expected headers' do
...@@ -475,7 +475,7 @@ describe SnippetsController do ...@@ -475,7 +475,7 @@ describe SnippetsController do
get :raw, id: personal_snippet.to_param get :raw, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
...@@ -500,7 +500,7 @@ describe SnippetsController do ...@@ -500,7 +500,7 @@ describe SnippetsController do
get :raw, id: personal_snippet.to_param get :raw, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
context 'CRLF line ending' do context 'CRLF line ending' do
...@@ -527,7 +527,7 @@ describe SnippetsController do ...@@ -527,7 +527,7 @@ describe SnippetsController do
get :raw, id: personal_snippet.to_param get :raw, id: personal_snippet.to_param
expect(assigns(:snippet)).to eq(personal_snippet) expect(assigns(:snippet)).to eq(personal_snippet)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
end end
end end
...@@ -541,7 +541,7 @@ describe SnippetsController do ...@@ -541,7 +541,7 @@ describe SnippetsController do
it 'responds with status 404' do it 'responds with status 404' do
get :raw, id: 'doesntexist' get :raw, id: 'doesntexist'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
......
...@@ -18,7 +18,7 @@ describe UploadsController do ...@@ -18,7 +18,7 @@ describe UploadsController do
it "returns 401 when the user is not logged in" do it "returns 401 when the user is not logged in" do
post :create, model: model, id: snippet.id, format: :json post :create, model: model, id: snippet.id, format: :json
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it "returns 404 when user can't comment on a snippet" do it "returns 404 when user can't comment on a snippet" do
...@@ -27,7 +27,7 @@ describe UploadsController do ...@@ -27,7 +27,7 @@ describe UploadsController do
sign_in(user) sign_in(user)
post :create, model: model, id: private_snippet.id, format: :json post :create, model: model, id: private_snippet.id, format: :json
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -39,7 +39,7 @@ describe UploadsController do ...@@ -39,7 +39,7 @@ describe UploadsController do
it "returns an error without file" do it "returns an error without file" do
post :create, model: model, id: snippet.id, format: :json post :create, model: model, id: snippet.id, format: :json
expect(response).to have_http_status(422) expect(response).to have_gitlab_http_status(422)
end end
it "returns an error with invalid model" do it "returns an error with invalid model" do
...@@ -50,7 +50,7 @@ describe UploadsController do ...@@ -50,7 +50,7 @@ describe UploadsController do
it "returns 404 status when object not found" do it "returns 404 status when object not found" do
post :create, model: model, id: 9999, format: :json post :create, model: model, id: 9999, format: :json
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
context 'with valid image' do context 'with valid image' do
...@@ -174,7 +174,7 @@ describe UploadsController do ...@@ -174,7 +174,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png" get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -190,7 +190,7 @@ describe UploadsController do ...@@ -190,7 +190,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png" get :show, model: "user", mounted_as: "avatar", id: user.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -214,7 +214,7 @@ describe UploadsController do ...@@ -214,7 +214,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png" get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -233,7 +233,7 @@ describe UploadsController do ...@@ -233,7 +233,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png" get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -285,7 +285,7 @@ describe UploadsController do ...@@ -285,7 +285,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png" get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -301,7 +301,7 @@ describe UploadsController do ...@@ -301,7 +301,7 @@ describe UploadsController do
it "responds with status 404" do it "responds with status 404" do
get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png" get :show, model: "project", mounted_as: "avatar", id: project.id, filename: "image.png"
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -316,7 +316,7 @@ describe UploadsController do ...@@ -316,7 +316,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png" get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -335,7 +335,7 @@ describe UploadsController do ...@@ -335,7 +335,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png" get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -378,7 +378,7 @@ describe UploadsController do ...@@ -378,7 +378,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png" get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -394,7 +394,7 @@ describe UploadsController do ...@@ -394,7 +394,7 @@ describe UploadsController do
it "responds with status 404" do it "responds with status 404" do
get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png" get :show, model: "group", mounted_as: "avatar", id: group.id, filename: "image.png"
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -414,7 +414,7 @@ describe UploadsController do ...@@ -414,7 +414,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png" get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -433,7 +433,7 @@ describe UploadsController do ...@@ -433,7 +433,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png" get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -485,7 +485,7 @@ describe UploadsController do ...@@ -485,7 +485,7 @@ describe UploadsController do
it "responds with status 200" do it "responds with status 200" do
get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png" get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -501,7 +501,7 @@ describe UploadsController do ...@@ -501,7 +501,7 @@ describe UploadsController do
it "responds with status 404" do it "responds with status 404" do
get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png" get :show, model: "note", mounted_as: "attachment", id: note.id, filename: "image.png"
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -516,7 +516,7 @@ describe UploadsController do ...@@ -516,7 +516,7 @@ describe UploadsController do
it 'responds with status 200' do it 'responds with status 200' do
get :show, model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png' get :show, model: 'appearance', mounted_as: 'header_logo', id: appearance.id, filename: 'dk.png'
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
...@@ -535,7 +535,7 @@ describe UploadsController do ...@@ -535,7 +535,7 @@ describe UploadsController do
it 'responds with status 200' do it 'responds with status 200' do
get :show, model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png' get :show, model: 'appearance', mounted_as: 'logo', id: appearance.id, filename: 'dk.png'
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it_behaves_like 'content not cached without revalidation' do it_behaves_like 'content not cached without revalidation' do
......
...@@ -24,7 +24,7 @@ describe UsersController do ...@@ -24,7 +24,7 @@ describe UsersController do
it 'renders the show template' do it 'renders the show template' do
get :show, username: user.username get :show, username: user.username
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('show') expect(response).to render_template('show')
end end
end end
...@@ -49,7 +49,7 @@ describe UsersController do ...@@ -49,7 +49,7 @@ describe UsersController do
it 'renders show' do it 'renders show' do
get :show, username: user.username get :show, username: user.username
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('show') expect(response).to render_template('show')
end end
end end
...@@ -70,7 +70,7 @@ describe UsersController do ...@@ -70,7 +70,7 @@ describe UsersController do
it 'renders 404' do it 'renders 404' do
get :show, username: 'nonexistent' get :show, username: 'nonexistent'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -82,7 +82,7 @@ describe UsersController do ...@@ -82,7 +82,7 @@ describe UsersController do
get :calendar, username: user.username, format: :json get :calendar, username: user.username, format: :json
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
context 'forked project' do context 'forked project' do
...@@ -139,7 +139,7 @@ describe UsersController do ...@@ -139,7 +139,7 @@ describe UsersController do
context 'format html' do context 'format html' do
it 'renders snippets page' do it 'renders snippets page' do
get :snippets, username: user.username get :snippets, username: user.username
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('show') expect(response).to render_template('show')
end end
end end
...@@ -147,7 +147,7 @@ describe UsersController do ...@@ -147,7 +147,7 @@ describe UsersController do
context 'format json' do context 'format json' do
it 'response with snippets json data' do it 'response with snippets json data' do
get :snippets, username: user.username, format: :json get :snippets, username: user.username, format: :json
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(JSON.parse(response.body)).to have_key('html') expect(JSON.parse(response.body)).to have_key('html')
end end
end end
......
...@@ -33,7 +33,7 @@ feature 'Profile > Chat' do ...@@ -33,7 +33,7 @@ feature 'Profile > Chat' do
scenario 'second use of link is denied' do scenario 'second use of link is denied' do
visit authorize_path visit authorize_path
expect(page).to have_http_status(:not_found) expect(page).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -51,7 +51,7 @@ feature 'Profile > Chat' do ...@@ -51,7 +51,7 @@ feature 'Profile > Chat' do
scenario 'second use of link is denied' do scenario 'second use of link is denied' do
visit authorize_path visit authorize_path
expect(page).to have_http_status(:not_found) expect(page).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -58,7 +58,7 @@ describe 'Profile > Password' do ...@@ -58,7 +58,7 @@ describe 'Profile > Password' do
visit edit_profile_password_path visit edit_profile_password_path
expect(page).to have_http_status(200) expect(page).to have_gitlab_http_status(200)
end end
end end
...@@ -68,7 +68,7 @@ describe 'Profile > Password' do ...@@ -68,7 +68,7 @@ describe 'Profile > Password' do
it 'renders 404' do it 'renders 404' do
visit edit_profile_password_path visit edit_profile_password_path
expect(page).to have_http_status(404) expect(page).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -50,7 +50,7 @@ feature 'test coverage badge' do ...@@ -50,7 +50,7 @@ feature 'test coverage badge' do
scenario 'user requests test coverage badge image' do scenario 'user requests test coverage badge image' do
show_test_coverage_badge show_test_coverage_badge
expect(page).to have_http_status(404) expect(page).to have_gitlab_http_status(404)
end end
end end
......
...@@ -198,7 +198,7 @@ feature 'Environment' do ...@@ -198,7 +198,7 @@ feature 'Environment' do
end end
it 'renders a correct environment folder' do it 'renders a correct environment folder' do
expect(page).to have_http_status(:ok) expect(page).to have_gitlab_http_status(:ok)
expect(page).to have_content('Environments / staging-1.0') expect(page).to have_content('Environments / staging-1.0')
end end
end end
......
...@@ -396,7 +396,7 @@ feature 'Jobs' do ...@@ -396,7 +396,7 @@ feature 'Jobs' do
end end
it 'shows the right status and buttons', :js do it 'shows the right status and buttons', :js do
expect(page).to have_http_status(200) expect(page).to have_gitlab_http_status(200)
page.within('aside.right-sidebar') do page.within('aside.right-sidebar') do
expect(page).to have_content 'Cancel' expect(page).to have_content 'Cancel'
end end
......
...@@ -525,7 +525,7 @@ describe 'Pipelines', :js do ...@@ -525,7 +525,7 @@ describe 'Pipelines', :js do
let(:project) { create(:project, :public, :repository) } let(:project) { create(:project, :public, :repository) }
it { expect(page).to have_content 'Build with confidence' } it { expect(page).to have_content 'Build with confidence' }
it { expect(page).to have_http_status(:success) } it { expect(page).to have_gitlab_http_status(:success) }
end end
context 'when project is private' do context 'when project is private' do
......
...@@ -35,7 +35,7 @@ describe API::AccessRequests do ...@@ -35,7 +35,7 @@ describe API::AccessRequests do
user = public_send(type) user = public_send(type)
get api("/#{source_type.pluralize}/#{source.id}/access_requests", user) get api("/#{source_type.pluralize}/#{source.id}/access_requests", user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
end end
...@@ -45,7 +45,7 @@ describe API::AccessRequests do ...@@ -45,7 +45,7 @@ describe API::AccessRequests do
it 'returns access requesters' do it 'returns access requesters' do
get api("/#{source_type.pluralize}/#{source.id}/access_requests", master) get api("/#{source_type.pluralize}/#{source.id}/access_requests", master)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.size).to eq(1) expect(json_response.size).to eq(1)
...@@ -68,7 +68,7 @@ describe API::AccessRequests do ...@@ -68,7 +68,7 @@ describe API::AccessRequests do
user = public_send(type) user = public_send(type)
post api("/#{source_type.pluralize}/#{source.id}/access_requests", user) post api("/#{source_type.pluralize}/#{source.id}/access_requests", user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end.not_to change { source.requesters.count } end.not_to change { source.requesters.count }
end end
end end
...@@ -80,7 +80,7 @@ describe API::AccessRequests do ...@@ -80,7 +80,7 @@ describe API::AccessRequests do
expect do expect do
post api("/#{source_type.pluralize}/#{source.id}/access_requests", access_requester) post api("/#{source_type.pluralize}/#{source.id}/access_requests", access_requester)
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end.not_to change { source.requesters.count } end.not_to change { source.requesters.count }
end end
end end
...@@ -95,7 +95,7 @@ describe API::AccessRequests do ...@@ -95,7 +95,7 @@ describe API::AccessRequests do
expect do expect do
post api("/#{source_type.pluralize}/#{source.id}/access_requests", stranger) post api("/#{source_type.pluralize}/#{source.id}/access_requests", stranger)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end.not_to change { source.requesters.count } end.not_to change { source.requesters.count }
end end
end end
...@@ -104,7 +104,7 @@ describe API::AccessRequests do ...@@ -104,7 +104,7 @@ describe API::AccessRequests do
expect do expect do
post api("/#{source_type.pluralize}/#{source.id}/access_requests", stranger) post api("/#{source_type.pluralize}/#{source.id}/access_requests", stranger)
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
end.to change { source.requesters.count }.by(1) end.to change { source.requesters.count }.by(1)
# User attributes # User attributes
...@@ -135,7 +135,7 @@ describe API::AccessRequests do ...@@ -135,7 +135,7 @@ describe API::AccessRequests do
user = public_send(type) user = public_send(type)
put api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}/approve", user) put api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}/approve", user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
end end
...@@ -147,7 +147,7 @@ describe API::AccessRequests do ...@@ -147,7 +147,7 @@ describe API::AccessRequests do
put api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}/approve", master), put api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}/approve", master),
access_level: Member::MASTER access_level: Member::MASTER
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
end.to change { source.members.count }.by(1) end.to change { source.members.count }.by(1)
# User attributes # User attributes
expect(json_response['id']).to eq(access_requester.id) expect(json_response['id']).to eq(access_requester.id)
...@@ -166,7 +166,7 @@ describe API::AccessRequests do ...@@ -166,7 +166,7 @@ describe API::AccessRequests do
expect do expect do
put api("/#{source_type.pluralize}/#{source.id}/access_requests/#{stranger.id}/approve", master) put api("/#{source_type.pluralize}/#{source.id}/access_requests/#{stranger.id}/approve", master)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end.not_to change { source.members.count } end.not_to change { source.members.count }
end end
end end
...@@ -187,7 +187,7 @@ describe API::AccessRequests do ...@@ -187,7 +187,7 @@ describe API::AccessRequests do
user = public_send(type) user = public_send(type)
delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}", user) delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}", user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
end end
...@@ -198,7 +198,7 @@ describe API::AccessRequests do ...@@ -198,7 +198,7 @@ describe API::AccessRequests do
expect do expect do
delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}", access_requester) delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}", access_requester)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end.to change { source.requesters.count }.by(-1) end.to change { source.requesters.count }.by(-1)
end end
end end
...@@ -208,7 +208,7 @@ describe API::AccessRequests do ...@@ -208,7 +208,7 @@ describe API::AccessRequests do
expect do expect do
delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}", master) delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{access_requester.id}", master)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end.to change { source.requesters.count }.by(-1) end.to change { source.requesters.count }.by(-1)
end end
...@@ -217,7 +217,7 @@ describe API::AccessRequests do ...@@ -217,7 +217,7 @@ describe API::AccessRequests do
expect do expect do
delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{developer.id}", master) delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{developer.id}", master)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end.not_to change { source.requesters.count } end.not_to change { source.requesters.count }
end end
end end
...@@ -227,7 +227,7 @@ describe API::AccessRequests do ...@@ -227,7 +227,7 @@ describe API::AccessRequests do
expect do expect do
delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{stranger.id}", master) delete api("/#{source_type.pluralize}/#{source.id}/access_requests/#{stranger.id}", master)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end.not_to change { source.requesters.count } end.not_to change { source.requesters.count }
end end
end end
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ describe API::Boards do ...@@ -44,7 +44,7 @@ describe API::Boards do
it "returns authentication error" do it "returns authentication error" do
get api(base_url) get api(base_url)
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
...@@ -52,7 +52,7 @@ describe API::Boards do ...@@ -52,7 +52,7 @@ describe API::Boards do
it "returns the project issue board" do it "returns the project issue board" do
get api(base_url, user) get api(base_url, user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.length).to eq(1) expect(json_response.length).to eq(1)
...@@ -70,7 +70,7 @@ describe API::Boards do ...@@ -70,7 +70,7 @@ describe API::Boards do
it 'returns issue board lists' do it 'returns issue board lists' do
get api(base_url, user) get api(base_url, user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.length).to eq(2) expect(json_response.length).to eq(2)
...@@ -80,7 +80,7 @@ describe API::Boards do ...@@ -80,7 +80,7 @@ describe API::Boards do
it 'returns 404 if board not found' do it 'returns 404 if board not found' do
get api("/projects/#{project.id}/boards/22343/lists", user) get api("/projects/#{project.id}/boards/22343/lists", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -90,7 +90,7 @@ describe API::Boards do ...@@ -90,7 +90,7 @@ describe API::Boards do
it 'returns a list' do it 'returns a list' do
get api("#{base_url}/#{dev_list.id}", user) get api("#{base_url}/#{dev_list.id}", user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['id']).to eq(dev_list.id) expect(json_response['id']).to eq(dev_list.id)
expect(json_response['label']['name']).to eq(dev_label.title) expect(json_response['label']['name']).to eq(dev_label.title)
expect(json_response['position']).to eq(1) expect(json_response['position']).to eq(1)
...@@ -99,7 +99,7 @@ describe API::Boards do ...@@ -99,7 +99,7 @@ describe API::Boards do
it 'returns 404 if list not found' do it 'returns 404 if list not found' do
get api("#{base_url}/5324", user) get api("#{base_url}/5324", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -113,7 +113,7 @@ describe API::Boards do ...@@ -113,7 +113,7 @@ describe API::Boards do
post api(base_url, user), label_id: group_label.id post api(base_url, user), label_id: group_label.id
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['label']['name']).to eq(group_label.title) expect(json_response['label']['name']).to eq(group_label.title)
expect(json_response['position']).to eq(3) expect(json_response['position']).to eq(3)
end end
...@@ -121,7 +121,7 @@ describe API::Boards do ...@@ -121,7 +121,7 @@ describe API::Boards do
it 'creates a new issue board list for project labels' do it 'creates a new issue board list for project labels' do
post api(base_url, user), label_id: ux_label.id post api(base_url, user), label_id: ux_label.id
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['label']['name']).to eq(ux_label.title) expect(json_response['label']['name']).to eq(ux_label.title)
expect(json_response['position']).to eq(3) expect(json_response['position']).to eq(3)
end end
...@@ -129,13 +129,13 @@ describe API::Boards do ...@@ -129,13 +129,13 @@ describe API::Boards do
it 'returns 400 when creating a new list if label_id is invalid' do it 'returns 400 when creating a new list if label_id is invalid' do
post api(base_url, user), label_id: 23423 post api(base_url, user), label_id: 23423
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
it 'returns 403 for project members with guest role' do it 'returns 403 for project members with guest role' do
put api("#{base_url}/#{test_list.id}", guest), position: 1 put api("#{base_url}/#{test_list.id}", guest), position: 1
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -146,7 +146,7 @@ describe API::Boards do ...@@ -146,7 +146,7 @@ describe API::Boards do
put api("#{base_url}/#{test_list.id}", user), put api("#{base_url}/#{test_list.id}", user),
position: 1 position: 1
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['position']).to eq(1) expect(json_response['position']).to eq(1)
end end
...@@ -154,14 +154,14 @@ describe API::Boards do ...@@ -154,14 +154,14 @@ describe API::Boards do
put api("#{base_url}/44444", user), put api("#{base_url}/44444", user),
position: 1 position: 1
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it "returns 403 for project members with guest role" do it "returns 403 for project members with guest role" do
put api("#{base_url}/#{test_list.id}", guest), put api("#{base_url}/#{test_list.id}", guest),
position: 1 position: 1
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -171,19 +171,19 @@ describe API::Boards do ...@@ -171,19 +171,19 @@ describe API::Boards do
it "rejects a non member from deleting a list" do it "rejects a non member from deleting a list" do
delete api("#{base_url}/#{dev_list.id}", non_member) delete api("#{base_url}/#{dev_list.id}", non_member)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it "rejects a user with guest role from deleting a list" do it "rejects a user with guest role from deleting a list" do
delete api("#{base_url}/#{dev_list.id}", guest) delete api("#{base_url}/#{dev_list.id}", guest)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it "returns 404 error if list id not found" do it "returns 404 error if list id not found" do
delete api("#{base_url}/44444", user) delete api("#{base_url}/44444", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
context "when the user is project owner" do context "when the user is project owner" do
...@@ -196,7 +196,7 @@ describe API::Boards do ...@@ -196,7 +196,7 @@ describe API::Boards do
it "deletes the list if an admin requests it" do it "deletes the list if an admin requests it" do
delete api("#{base_url}/#{dev_list.id}", owner) delete api("#{base_url}/#{dev_list.id}", owner)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end end
it_behaves_like '412 response' do it_behaves_like '412 response' do
......
...@@ -9,13 +9,13 @@ describe API::BroadcastMessages do ...@@ -9,13 +9,13 @@ describe API::BroadcastMessages do
it 'returns a 401 for anonymous users' do it 'returns a 401 for anonymous users' do
get api('/broadcast_messages') get api('/broadcast_messages')
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it 'returns a 403 for users' do it 'returns a 403 for users' do
get api('/broadcast_messages', user) get api('/broadcast_messages', user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it 'returns an Array of BroadcastMessages for admins' do it 'returns an Array of BroadcastMessages for admins' do
...@@ -23,7 +23,7 @@ describe API::BroadcastMessages do ...@@ -23,7 +23,7 @@ describe API::BroadcastMessages do
get api('/broadcast_messages', admin) get api('/broadcast_messages', admin)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_kind_of(Array) expect(json_response).to be_kind_of(Array)
expect(json_response.first.keys) expect(json_response.first.keys)
...@@ -35,19 +35,19 @@ describe API::BroadcastMessages do ...@@ -35,19 +35,19 @@ describe API::BroadcastMessages do
it 'returns a 401 for anonymous users' do it 'returns a 401 for anonymous users' do
get api("/broadcast_messages/#{message.id}") get api("/broadcast_messages/#{message.id}")
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it 'returns a 403 for users' do it 'returns a 403 for users' do
get api("/broadcast_messages/#{message.id}", user) get api("/broadcast_messages/#{message.id}", user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it 'returns the specified message for admins' do it 'returns the specified message for admins' do
get api("/broadcast_messages/#{message.id}", admin) get api("/broadcast_messages/#{message.id}", admin)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['id']).to eq message.id expect(json_response['id']).to eq message.id
expect(json_response.keys) expect(json_response.keys)
.to match_array(%w(id message starts_at ends_at color font active)) .to match_array(%w(id message starts_at ends_at color font active))
...@@ -58,13 +58,13 @@ describe API::BroadcastMessages do ...@@ -58,13 +58,13 @@ describe API::BroadcastMessages do
it 'returns a 401 for anonymous users' do it 'returns a 401 for anonymous users' do
post api('/broadcast_messages'), attributes_for(:broadcast_message) post api('/broadcast_messages'), attributes_for(:broadcast_message)
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it 'returns a 403 for users' do it 'returns a 403 for users' do
post api('/broadcast_messages', user), attributes_for(:broadcast_message) post api('/broadcast_messages', user), attributes_for(:broadcast_message)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
context 'as an admin' do context 'as an admin' do
...@@ -74,7 +74,7 @@ describe API::BroadcastMessages do ...@@ -74,7 +74,7 @@ describe API::BroadcastMessages do
post api('/broadcast_messages', admin), attrs post api('/broadcast_messages', admin), attrs
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response['error']).to eq 'message is missing' expect(json_response['error']).to eq 'message is missing'
end end
...@@ -83,7 +83,7 @@ describe API::BroadcastMessages do ...@@ -83,7 +83,7 @@ describe API::BroadcastMessages do
travel_to(time) do travel_to(time) do
post api('/broadcast_messages', admin), message: 'Test message' post api('/broadcast_messages', admin), message: 'Test message'
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['starts_at']).to eq '2016-07-02T10:11:12.000Z' expect(json_response['starts_at']).to eq '2016-07-02T10:11:12.000Z'
expect(json_response['ends_at']).to eq '2016-07-02T11:11:12.000Z' expect(json_response['ends_at']).to eq '2016-07-02T11:11:12.000Z'
end end
...@@ -94,7 +94,7 @@ describe API::BroadcastMessages do ...@@ -94,7 +94,7 @@ describe API::BroadcastMessages do
post api('/broadcast_messages', admin), attrs post api('/broadcast_messages', admin), attrs
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['color']).to eq attrs[:color] expect(json_response['color']).to eq attrs[:color]
expect(json_response['font']).to eq attrs[:font] expect(json_response['font']).to eq attrs[:font]
end end
...@@ -106,14 +106,14 @@ describe API::BroadcastMessages do ...@@ -106,14 +106,14 @@ describe API::BroadcastMessages do
put api("/broadcast_messages/#{message.id}"), put api("/broadcast_messages/#{message.id}"),
attributes_for(:broadcast_message) attributes_for(:broadcast_message)
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it 'returns a 403 for users' do it 'returns a 403 for users' do
put api("/broadcast_messages/#{message.id}", user), put api("/broadcast_messages/#{message.id}", user),
attributes_for(:broadcast_message) attributes_for(:broadcast_message)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
context 'as an admin' do context 'as an admin' do
...@@ -122,7 +122,7 @@ describe API::BroadcastMessages do ...@@ -122,7 +122,7 @@ describe API::BroadcastMessages do
put api("/broadcast_messages/#{message.id}", admin), attrs put api("/broadcast_messages/#{message.id}", admin), attrs
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['color']).to eq attrs[:color] expect(json_response['color']).to eq attrs[:color]
expect(json_response['font']).to eq attrs[:font] expect(json_response['font']).to eq attrs[:font]
end end
...@@ -134,7 +134,7 @@ describe API::BroadcastMessages do ...@@ -134,7 +134,7 @@ describe API::BroadcastMessages do
put api("/broadcast_messages/#{message.id}", admin), attrs put api("/broadcast_messages/#{message.id}", admin), attrs
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['starts_at']).to eq '2016-07-02T10:11:12.000Z' expect(json_response['starts_at']).to eq '2016-07-02T10:11:12.000Z'
expect(json_response['ends_at']).to eq '2016-07-02T13:11:12.000Z' expect(json_response['ends_at']).to eq '2016-07-02T13:11:12.000Z'
end end
...@@ -145,7 +145,7 @@ describe API::BroadcastMessages do ...@@ -145,7 +145,7 @@ describe API::BroadcastMessages do
put api("/broadcast_messages/#{message.id}", admin), attrs put api("/broadcast_messages/#{message.id}", admin), attrs
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect { message.reload }.to change { message.message }.to('new message') expect { message.reload }.to change { message.message }.to('new message')
end end
end end
...@@ -156,14 +156,14 @@ describe API::BroadcastMessages do ...@@ -156,14 +156,14 @@ describe API::BroadcastMessages do
delete api("/broadcast_messages/#{message.id}"), delete api("/broadcast_messages/#{message.id}"),
attributes_for(:broadcast_message) attributes_for(:broadcast_message)
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it 'returns a 403 for users' do it 'returns a 403 for users' do
delete api("/broadcast_messages/#{message.id}", user), delete api("/broadcast_messages/#{message.id}", user),
attributes_for(:broadcast_message) attributes_for(:broadcast_message)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it_behaves_like '412 response' do it_behaves_like '412 response' do
...@@ -174,7 +174,7 @@ describe API::BroadcastMessages do ...@@ -174,7 +174,7 @@ describe API::BroadcastMessages do
expect do expect do
delete api("/broadcast_messages/#{message.id}", admin) delete api("/broadcast_messages/#{message.id}", admin)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end.to change { BroadcastMessage.count }.by(-1) end.to change { BroadcastMessage.count }.by(-1)
end end
end end
......
...@@ -8,13 +8,13 @@ describe API::CircuitBreakers do ...@@ -8,13 +8,13 @@ describe API::CircuitBreakers do
it 'returns a 401 for anonymous users' do it 'returns a 401 for anonymous users' do
get api('/circuit_breakers/repository_storage') get api('/circuit_breakers/repository_storage')
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
it 'returns a 403 for users' do it 'returns a 403 for users' do
get api('/circuit_breakers/repository_storage', user) get api('/circuit_breakers/repository_storage', user)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it 'returns an Array of storages' do it 'returns an Array of storages' do
...@@ -24,7 +24,7 @@ describe API::CircuitBreakers do ...@@ -24,7 +24,7 @@ describe API::CircuitBreakers do
get api('/circuit_breakers/repository_storage', admin) get api('/circuit_breakers/repository_storage', admin)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response).to be_kind_of(Array) expect(json_response).to be_kind_of(Array)
expect(json_response.first['storage_name']).to eq('broken') expect(json_response.first['storage_name']).to eq('broken')
expect(json_response.first['failing_on_hosts']).to eq(['web01']) expect(json_response.first['failing_on_hosts']).to eq(['web01'])
...@@ -39,7 +39,7 @@ describe API::CircuitBreakers do ...@@ -39,7 +39,7 @@ describe API::CircuitBreakers do
get api('/circuit_breakers/repository_storage/failing', admin) get api('/circuit_breakers/repository_storage/failing', admin)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response).to be_kind_of(Array) expect(json_response).to be_kind_of(Array)
end end
end end
...@@ -51,7 +51,7 @@ describe API::CircuitBreakers do ...@@ -51,7 +51,7 @@ describe API::CircuitBreakers do
delete api('/circuit_breakers/repository_storage', admin) delete api('/circuit_breakers/repository_storage', admin)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end end
end end
end end
...@@ -39,7 +39,7 @@ describe API::CommitStatuses do ...@@ -39,7 +39,7 @@ describe API::CommitStatuses do
end end
it 'returns latest commit statuses' do it 'returns latest commit statuses' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
...@@ -55,7 +55,7 @@ describe API::CommitStatuses do ...@@ -55,7 +55,7 @@ describe API::CommitStatuses do
end end
it 'returns all commit statuses' do it 'returns all commit statuses' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status1.id, status2.id, expect(statuses_id).to contain_exactly(status1.id, status2.id,
...@@ -70,7 +70,7 @@ describe API::CommitStatuses do ...@@ -70,7 +70,7 @@ describe API::CommitStatuses do
end end
it 'returns latest commit statuses for specific ref' do it 'returns latest commit statuses for specific ref' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status3.id, status5.id) expect(statuses_id).to contain_exactly(status3.id, status5.id)
...@@ -83,7 +83,7 @@ describe API::CommitStatuses do ...@@ -83,7 +83,7 @@ describe API::CommitStatuses do
end end
it 'return latest commit statuses for specific name' do it 'return latest commit statuses for specific name' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(statuses_id).to contain_exactly(status4.id, status5.id) expect(statuses_id).to contain_exactly(status4.id, status5.id)
...@@ -110,7 +110,7 @@ describe API::CommitStatuses do ...@@ -110,7 +110,7 @@ describe API::CommitStatuses do
end end
it "does not return project commits" do it "does not return project commits" do
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -120,7 +120,7 @@ describe API::CommitStatuses do ...@@ -120,7 +120,7 @@ describe API::CommitStatuses do
end end
it "does not return project commits" do it "does not return project commits" do
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
end end
...@@ -135,7 +135,7 @@ describe API::CommitStatuses do ...@@ -135,7 +135,7 @@ describe API::CommitStatuses do
it 'creates commit status' do it 'creates commit status' do
post api(post_url, developer), state: status post api(post_url, developer), state: status
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['sha']).to eq(commit.id) expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq(status) expect(json_response['status']).to eq(status)
expect(json_response['name']).to eq('default') expect(json_response['name']).to eq('default')
...@@ -159,7 +159,7 @@ describe API::CommitStatuses do ...@@ -159,7 +159,7 @@ describe API::CommitStatuses do
it "to #{status}" do it "to #{status}" do
expect { post api(post_url, developer), state: status }.not_to change { CommitStatus.count } expect { post api(post_url, developer), state: status }.not_to change { CommitStatus.count }
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['status']).to eq(status) expect(json_response['status']).to eq(status)
end end
end end
...@@ -181,7 +181,7 @@ describe API::CommitStatuses do ...@@ -181,7 +181,7 @@ describe API::CommitStatuses do
it 'creates commit status' do it 'creates commit status' do
subject subject
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['sha']).to eq(commit.id) expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq('success') expect(json_response['status']).to eq('success')
expect(json_response['name']).to eq('coverage') expect(json_response['name']).to eq('coverage')
...@@ -197,7 +197,7 @@ describe API::CommitStatuses do ...@@ -197,7 +197,7 @@ describe API::CommitStatuses do
it 'sets head pipeline' do it 'sets head pipeline' do
subject subject
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(merge_request.reload.head_pipeline).not_to be_nil expect(merge_request.reload.head_pipeline).not_to be_nil
end end
end end
...@@ -224,7 +224,7 @@ describe API::CommitStatuses do ...@@ -224,7 +224,7 @@ describe API::CommitStatuses do
end end
it 'updates a commit status' do it 'updates a commit status' do
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['sha']).to eq(commit.id) expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq('success') expect(json_response['status']).to eq('success')
expect(json_response['name']).to eq('coverage') expect(json_response['name']).to eq('coverage')
...@@ -250,7 +250,7 @@ describe API::CommitStatuses do ...@@ -250,7 +250,7 @@ describe API::CommitStatuses do
end end
it 'correctly posts a new commit status' do it 'correctly posts a new commit status' do
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['sha']).to eq(commit.id) expect(json_response['sha']).to eq(commit.id)
expect(json_response['status']).to eq('success') expect(json_response['status']).to eq('success')
end end
...@@ -268,7 +268,7 @@ describe API::CommitStatuses do ...@@ -268,7 +268,7 @@ describe API::CommitStatuses do
end end
it 'does not create commit status' do it 'does not create commit status' do
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
end end
...@@ -278,7 +278,7 @@ describe API::CommitStatuses do ...@@ -278,7 +278,7 @@ describe API::CommitStatuses do
end end
it 'does not create commit status' do it 'does not create commit status' do
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
end end
...@@ -290,7 +290,7 @@ describe API::CommitStatuses do ...@@ -290,7 +290,7 @@ describe API::CommitStatuses do
end end
it 'returns not found error' do it 'returns not found error' do
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -301,7 +301,7 @@ describe API::CommitStatuses do ...@@ -301,7 +301,7 @@ describe API::CommitStatuses do
end end
it 'responds with bad request status and validation errors' do it 'responds with bad request status and validation errors' do
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response['message']['target_url']) expect(json_response['message']['target_url'])
.to include 'must be a valid URL' .to include 'must be a valid URL'
end end
...@@ -314,7 +314,7 @@ describe API::CommitStatuses do ...@@ -314,7 +314,7 @@ describe API::CommitStatuses do
end end
it 'does not create commit status' do it 'does not create commit status' do
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -324,7 +324,7 @@ describe API::CommitStatuses do ...@@ -324,7 +324,7 @@ describe API::CommitStatuses do
end end
it 'does not create commit status' do it 'does not create commit status' do
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
end end
...@@ -334,7 +334,7 @@ describe API::CommitStatuses do ...@@ -334,7 +334,7 @@ describe API::CommitStatuses do
end end
it 'does not create commit status' do it 'does not create commit status' do
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
end end
......
...@@ -24,7 +24,7 @@ describe API::Commits do ...@@ -24,7 +24,7 @@ describe API::Commits do
get api(route, current_user) get api(route, current_user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/commits') expect(response).to match_response_schema('public_api/v4/commits')
expect(json_response.first['id']).to eq(commit.id) expect(json_response.first['id']).to eq(commit.id)
expect(json_response.first['committer_name']).to eq(commit.committer_name) expect(json_response.first['committer_name']).to eq(commit.committer_name)
...@@ -119,7 +119,7 @@ describe API::Commits do ...@@ -119,7 +119,7 @@ describe API::Commits do
it "returns an invalid parameter error message" do it "returns an invalid parameter error message" do
get api("/projects/#{project_id}/repository/commits?since=invalid-date", user) get api("/projects/#{project_id}/repository/commits?since=invalid-date", user)
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response['error']).to eq('since is invalid') expect(json_response['error']).to eq('since is invalid')
end end
end end
...@@ -198,13 +198,13 @@ describe API::Commits do ...@@ -198,13 +198,13 @@ describe API::Commits do
it 'returns a 403 unauthorized for user without permissions' do it 'returns a 403 unauthorized for user without permissions' do
post api(url, guest) post api(url, guest)
expect(response).to have_http_status(403) expect(response).to have_gitlab_http_status(403)
end end
it 'returns a 400 bad request if no params are given' do it 'returns a 400 bad request if no params are given' do
post api(url, user) post api(url, user)
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
describe 'create' do describe 'create' do
...@@ -248,7 +248,7 @@ describe API::Commits do ...@@ -248,7 +248,7 @@ describe API::Commits do
it 'returns a 400 bad request if file exists' do it 'returns a 400 bad request if file exists' do
post api(url, user), invalid_c_params post api(url, user), invalid_c_params
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
context 'with project path containing a dot in URL' do context 'with project path containing a dot in URL' do
...@@ -257,7 +257,7 @@ describe API::Commits do ...@@ -257,7 +257,7 @@ describe API::Commits do
it 'a new file in project repo' do it 'a new file in project repo' do
post api(url, user), valid_c_params post api(url, user), valid_c_params
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
end end
end end
end end
...@@ -292,14 +292,14 @@ describe API::Commits do ...@@ -292,14 +292,14 @@ describe API::Commits do
it 'an existing file in project repo' do it 'an existing file in project repo' do
post api(url, user), valid_d_params post api(url, user), valid_d_params
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['title']).to eq(message) expect(json_response['title']).to eq(message)
end end
it 'returns a 400 bad request if file does not exist' do it 'returns a 400 bad request if file does not exist' do
post api(url, user), invalid_d_params post api(url, user), invalid_d_params
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
end end
...@@ -337,14 +337,14 @@ describe API::Commits do ...@@ -337,14 +337,14 @@ describe API::Commits do
it 'an existing file in project repo' do it 'an existing file in project repo' do
post api(url, user), valid_m_params post api(url, user), valid_m_params
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['title']).to eq(message) expect(json_response['title']).to eq(message)
end end
it 'returns a 400 bad request if file does not exist' do it 'returns a 400 bad request if file does not exist' do
post api(url, user), invalid_m_params post api(url, user), invalid_m_params
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
end end
...@@ -380,14 +380,14 @@ describe API::Commits do ...@@ -380,14 +380,14 @@ describe API::Commits do
it 'an existing file in project repo' do it 'an existing file in project repo' do
post api(url, user), valid_u_params post api(url, user), valid_u_params
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['title']).to eq(message) expect(json_response['title']).to eq(message)
end end
it 'returns a 400 bad request if file does not exist' do it 'returns a 400 bad request if file does not exist' do
post api(url, user), invalid_u_params post api(url, user), invalid_u_params
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
end end
...@@ -453,14 +453,14 @@ describe API::Commits do ...@@ -453,14 +453,14 @@ describe API::Commits do
it 'are commited as one in project repo' do it 'are commited as one in project repo' do
post api(url, user), valid_mo_params post api(url, user), valid_mo_params
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['title']).to eq(message) expect(json_response['title']).to eq(message)
end end
it 'return a 400 bad request if there are any issues' do it 'return a 400 bad request if there are any issues' do
post api(url, user), invalid_mo_params post api(url, user), invalid_mo_params
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
end end
end end
...@@ -571,7 +571,7 @@ describe API::Commits do ...@@ -571,7 +571,7 @@ describe API::Commits do
it 'includes a "created" status' do it 'includes a "created" status' do
get api(route, current_user) get api(route, current_user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/commit/detail') expect(response).to match_response_schema('public_api/v4/commit/detail')
expect(json_response['status']).to eq('created') expect(json_response['status']).to eq('created')
expect(json_response['last_pipeline']['id']).to eq(pipeline.id) expect(json_response['last_pipeline']['id']).to eq(pipeline.id)
...@@ -588,7 +588,7 @@ describe API::Commits do ...@@ -588,7 +588,7 @@ describe API::Commits do
it 'includes a "success" status' do it 'includes a "success" status' do
get api(route, current_user) get api(route, current_user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to match_response_schema('public_api/v4/commit/detail') expect(response).to match_response_schema('public_api/v4/commit/detail')
expect(json_response['status']).to eq('success') expect(json_response['status']).to eq('success')
end end
......
...@@ -48,7 +48,7 @@ describe API::DeployKeys do ...@@ -48,7 +48,7 @@ describe API::DeployKeys do
it 'returns array of ssh keys' do it 'returns array of ssh keys' do
get api("/projects/#{project.id}/deploy_keys", admin) get api("/projects/#{project.id}/deploy_keys", admin)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.first['title']).to eq(deploy_key.title) expect(json_response.first['title']).to eq(deploy_key.title)
...@@ -59,14 +59,14 @@ describe API::DeployKeys do ...@@ -59,14 +59,14 @@ describe API::DeployKeys do
it 'returns a single key' do it 'returns a single key' do
get api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", admin) get api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", admin)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['title']).to eq(deploy_key.title) expect(json_response['title']).to eq(deploy_key.title)
end end
it 'returns 404 Not Found with invalid ID' do it 'returns 404 Not Found with invalid ID' do
get api("/projects/#{project.id}/deploy_keys/404", admin) get api("/projects/#{project.id}/deploy_keys/404", admin)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -74,14 +74,14 @@ describe API::DeployKeys do ...@@ -74,14 +74,14 @@ describe API::DeployKeys do
it 'does not create an invalid ssh key' do it 'does not create an invalid ssh key' do
post api("/projects/#{project.id}/deploy_keys", admin), { title: 'invalid key' } post api("/projects/#{project.id}/deploy_keys", admin), { title: 'invalid key' }
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response['error']).to eq('key is missing') expect(json_response['error']).to eq('key is missing')
end end
it 'does not create a key without title' do it 'does not create a key without title' do
post api("/projects/#{project.id}/deploy_keys", admin), key: 'some key' post api("/projects/#{project.id}/deploy_keys", admin), key: 'some key'
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response['error']).to eq('title is missing') expect(json_response['error']).to eq('title is missing')
end end
...@@ -98,7 +98,7 @@ describe API::DeployKeys do ...@@ -98,7 +98,7 @@ describe API::DeployKeys do
post api("/projects/#{project.id}/deploy_keys", admin), { key: deploy_key.key, title: deploy_key.title } post api("/projects/#{project.id}/deploy_keys", admin), { key: deploy_key.key, title: deploy_key.title }
end.not_to change { project.deploy_keys.count } end.not_to change { project.deploy_keys.count }
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
end end
it 'joins an existing ssh key to a new project' do it 'joins an existing ssh key to a new project' do
...@@ -106,7 +106,7 @@ describe API::DeployKeys do ...@@ -106,7 +106,7 @@ describe API::DeployKeys do
post api("/projects/#{project2.id}/deploy_keys", admin), { key: deploy_key.key, title: deploy_key.title } post api("/projects/#{project2.id}/deploy_keys", admin), { key: deploy_key.key, title: deploy_key.title }
end.to change { project2.deploy_keys.count }.by(1) end.to change { project2.deploy_keys.count }.by(1)
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
end end
it 'accepts can_push parameter' do it 'accepts can_push parameter' do
...@@ -114,7 +114,7 @@ describe API::DeployKeys do ...@@ -114,7 +114,7 @@ describe API::DeployKeys do
post api("/projects/#{project.id}/deploy_keys", admin), key_attrs post api("/projects/#{project.id}/deploy_keys", admin), key_attrs
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['can_push']).to eq(true) expect(json_response['can_push']).to eq(true)
end end
end end
...@@ -130,7 +130,7 @@ describe API::DeployKeys do ...@@ -130,7 +130,7 @@ describe API::DeployKeys do
put api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", admin), { title: 'new title' } put api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", admin), { title: 'new title' }
end.not_to change(deploy_key, :title) end.not_to change(deploy_key, :title)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'does not update a public deploy key as non admin' do it 'does not update a public deploy key as non admin' do
...@@ -138,7 +138,7 @@ describe API::DeployKeys do ...@@ -138,7 +138,7 @@ describe API::DeployKeys do
put api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", user), { title: 'new title' } put api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", user), { title: 'new title' }
end.not_to change(deploy_key, :title) end.not_to change(deploy_key, :title)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'does not update a private key with invalid title' do it 'does not update a private key with invalid title' do
...@@ -148,7 +148,7 @@ describe API::DeployKeys do ...@@ -148,7 +148,7 @@ describe API::DeployKeys do
put api("/projects/#{project.id}/deploy_keys/#{private_deploy_key.id}", admin), { title: '' } put api("/projects/#{project.id}/deploy_keys/#{private_deploy_key.id}", admin), { title: '' }
end.not_to change(deploy_key, :title) end.not_to change(deploy_key, :title)
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
it 'updates a private ssh key with correct attributes' do it 'updates a private ssh key with correct attributes' do
...@@ -181,14 +181,14 @@ describe API::DeployKeys do ...@@ -181,14 +181,14 @@ describe API::DeployKeys do
expect do expect do
delete api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", admin) delete api("/projects/#{project.id}/deploy_keys/#{deploy_key.id}", admin)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end.to change { project.deploy_keys.count }.by(-1) end.to change { project.deploy_keys.count }.by(-1)
end end
it 'returns 404 Not Found with invalid ID' do it 'returns 404 Not Found with invalid ID' do
delete api("/projects/#{project.id}/deploy_keys/404", admin) delete api("/projects/#{project.id}/deploy_keys/404", admin)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it_behaves_like '412 response' do it_behaves_like '412 response' do
...@@ -205,7 +205,7 @@ describe API::DeployKeys do ...@@ -205,7 +205,7 @@ describe API::DeployKeys do
post api("/projects/#{project2.id}/deploy_keys/#{deploy_key.id}/enable", admin) post api("/projects/#{project2.id}/deploy_keys/#{deploy_key.id}/enable", admin)
end.to change { project2.deploy_keys.count }.from(0).to(1) end.to change { project2.deploy_keys.count }.from(0).to(1)
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['id']).to eq(deploy_key.id) expect(json_response['id']).to eq(deploy_key.id)
end end
end end
...@@ -214,7 +214,7 @@ describe API::DeployKeys do ...@@ -214,7 +214,7 @@ describe API::DeployKeys do
it 'returns a 404 error' do it 'returns a 404 error' do
post api("/projects/#{project2.id}/deploy_keys/#{deploy_key.id}/enable", user) post api("/projects/#{project2.id}/deploy_keys/#{deploy_key.id}/enable", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -15,7 +15,7 @@ describe API::Deployments do ...@@ -15,7 +15,7 @@ describe API::Deployments do
it 'returns projects deployments' do it 'returns projects deployments' do
get api("/projects/#{project.id}/deployments", user) get api("/projects/#{project.id}/deployments", user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.size).to eq(1) expect(json_response.size).to eq(1)
...@@ -28,7 +28,7 @@ describe API::Deployments do ...@@ -28,7 +28,7 @@ describe API::Deployments do
it 'returns a 404 status code' do it 'returns a 404 status code' do
get api("/projects/#{project.id}/deployments", non_member) get api("/projects/#{project.id}/deployments", non_member)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -38,7 +38,7 @@ describe API::Deployments do ...@@ -38,7 +38,7 @@ describe API::Deployments do
it 'returns the projects deployment' do it 'returns the projects deployment' do
get api("/projects/#{project.id}/deployments/#{deployment.id}", user) get api("/projects/#{project.id}/deployments/#{deployment.id}", user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['sha']).to match /\A\h{40}\z/ expect(json_response['sha']).to match /\A\h{40}\z/
expect(json_response['id']).to eq(deployment.id) expect(json_response['id']).to eq(deployment.id)
end end
...@@ -48,7 +48,7 @@ describe API::Deployments do ...@@ -48,7 +48,7 @@ describe API::Deployments do
it 'returns a 404 status code' do it 'returns a 404 status code' do
get api("/projects/#{project.id}/deployments/#{deployment.id}", non_member) get api("/projects/#{project.id}/deployments/#{deployment.id}", non_member)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
...@@ -8,7 +8,7 @@ describe 'doorkeeper access' do ...@@ -8,7 +8,7 @@ describe 'doorkeeper access' do
describe "unauthenticated" do describe "unauthenticated" do
it "returns authentication success" do it "returns authentication success" do
get api("/user"), access_token: token.token get api("/user"), access_token: token.token
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
include_examples 'user login request with unique ip limit' do include_examples 'user login request with unique ip limit' do
...@@ -21,14 +21,14 @@ describe 'doorkeeper access' do ...@@ -21,14 +21,14 @@ describe 'doorkeeper access' do
describe "when token invalid" do describe "when token invalid" do
it "returns authentication error" do it "returns authentication error" do
get api("/user"), access_token: "123a" get api("/user"), access_token: "123a"
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
describe "authorization by private token" do describe "authorization by private token" do
it "returns authentication success" do it "returns authentication success" do
get api("/user", user) get api("/user", user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
include_examples 'user login request with unique ip limit' do include_examples 'user login request with unique ip limit' do
...@@ -43,7 +43,7 @@ describe 'doorkeeper access' do ...@@ -43,7 +43,7 @@ describe 'doorkeeper access' do
user.block user.block
get api("/user"), access_token: token.token get api("/user"), access_token: token.token
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
...@@ -52,7 +52,7 @@ describe 'doorkeeper access' do ...@@ -52,7 +52,7 @@ describe 'doorkeeper access' do
user.ldap_block user.ldap_block
get api("/user"), access_token: token.token get api("/user"), access_token: token.token
expect(response).to have_http_status(401) expect(response).to have_gitlab_http_status(401)
end end
end end
end end
...@@ -25,7 +25,7 @@ describe API::Environments do ...@@ -25,7 +25,7 @@ describe API::Environments do
get api("/projects/#{project.id}/environments", user) get api("/projects/#{project.id}/environments", user)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(response).to include_pagination_headers expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.size).to eq(1) expect(json_response.size).to eq(1)
...@@ -39,7 +39,7 @@ describe API::Environments do ...@@ -39,7 +39,7 @@ describe API::Environments do
it 'returns a 404 status code' do it 'returns a 404 status code' do
get api("/projects/#{project.id}/environments", non_member) get api("/projects/#{project.id}/environments", non_member)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -49,7 +49,7 @@ describe API::Environments do ...@@ -49,7 +49,7 @@ describe API::Environments do
it 'creates a environment with valid params' do it 'creates a environment with valid params' do
post api("/projects/#{project.id}/environments", user), name: "mepmep" post api("/projects/#{project.id}/environments", user), name: "mepmep"
expect(response).to have_http_status(201) expect(response).to have_gitlab_http_status(201)
expect(json_response['name']).to eq('mepmep') expect(json_response['name']).to eq('mepmep')
expect(json_response['slug']).to eq('mepmep') expect(json_response['slug']).to eq('mepmep')
expect(json_response['external']).to be nil expect(json_response['external']).to be nil
...@@ -58,19 +58,19 @@ describe API::Environments do ...@@ -58,19 +58,19 @@ describe API::Environments do
it 'requires name to be passed' do it 'requires name to be passed' do
post api("/projects/#{project.id}/environments", user), external_url: 'test.gitlab.com' post api("/projects/#{project.id}/environments", user), external_url: 'test.gitlab.com'
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
it 'returns a 400 if environment already exists' do it 'returns a 400 if environment already exists' do
post api("/projects/#{project.id}/environments", user), name: environment.name post api("/projects/#{project.id}/environments", user), name: environment.name
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
end end
it 'returns a 400 if slug is specified' do it 'returns a 400 if slug is specified' do
post api("/projects/#{project.id}/environments", user), name: "foo", slug: "foo" post api("/projects/#{project.id}/environments", user), name: "foo", slug: "foo"
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response["error"]).to eq("slug is automatically generated and cannot be changed") expect(json_response["error"]).to eq("slug is automatically generated and cannot be changed")
end end
end end
...@@ -79,7 +79,7 @@ describe API::Environments do ...@@ -79,7 +79,7 @@ describe API::Environments do
it 'rejects the request' do it 'rejects the request' do
post api("/projects/#{project.id}/environments", non_member), name: 'gitlab.com' post api("/projects/#{project.id}/environments", non_member), name: 'gitlab.com'
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
it 'returns a 400 when the required params are missing' do it 'returns a 400 when the required params are missing' do
...@@ -94,7 +94,7 @@ describe API::Environments do ...@@ -94,7 +94,7 @@ describe API::Environments do
put api("/projects/#{project.id}/environments/#{environment.id}", user), put api("/projects/#{project.id}/environments/#{environment.id}", user),
name: 'Mepmep', external_url: url name: 'Mepmep', external_url: url
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['name']).to eq('Mepmep') expect(json_response['name']).to eq('Mepmep')
expect(json_response['external_url']).to eq(url) expect(json_response['external_url']).to eq(url)
end end
...@@ -104,7 +104,7 @@ describe API::Environments do ...@@ -104,7 +104,7 @@ describe API::Environments do
api_url = api("/projects/#{project.id}/environments/#{environment.id}", user) api_url = api("/projects/#{project.id}/environments/#{environment.id}", user)
put api_url, slug: slug + "-foo" put api_url, slug: slug + "-foo"
expect(response).to have_http_status(400) expect(response).to have_gitlab_http_status(400)
expect(json_response["error"]).to eq("slug is automatically generated and cannot be changed") expect(json_response["error"]).to eq("slug is automatically generated and cannot be changed")
end end
...@@ -113,7 +113,7 @@ describe API::Environments do ...@@ -113,7 +113,7 @@ describe API::Environments do
put api("/projects/#{project.id}/environments/#{environment.id}", user), put api("/projects/#{project.id}/environments/#{environment.id}", user),
name: 'Mepmep' name: 'Mepmep'
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
expect(json_response['name']).to eq('Mepmep') expect(json_response['name']).to eq('Mepmep')
expect(json_response['external_url']).to eq(url) expect(json_response['external_url']).to eq(url)
end end
...@@ -121,7 +121,7 @@ describe API::Environments do ...@@ -121,7 +121,7 @@ describe API::Environments do
it 'returns a 404 if the environment does not exist' do it 'returns a 404 if the environment does not exist' do
put api("/projects/#{project.id}/environments/12345", user) put api("/projects/#{project.id}/environments/12345", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
...@@ -130,13 +130,13 @@ describe API::Environments do ...@@ -130,13 +130,13 @@ describe API::Environments do
it 'returns a 200 for an existing environment' do it 'returns a 200 for an existing environment' do
delete api("/projects/#{project.id}/environments/#{environment.id}", user) delete api("/projects/#{project.id}/environments/#{environment.id}", user)
expect(response).to have_http_status(204) expect(response).to have_gitlab_http_status(204)
end end
it 'returns a 404 for non existing id' do it 'returns a 404 for non existing id' do
delete api("/projects/#{project.id}/environments/12345", user) delete api("/projects/#{project.id}/environments/12345", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
expect(json_response['message']).to eq('404 Not found') expect(json_response['message']).to eq('404 Not found')
end end
...@@ -149,7 +149,7 @@ describe API::Environments do ...@@ -149,7 +149,7 @@ describe API::Environments do
it 'rejects the request' do it 'rejects the request' do
delete api("/projects/#{project.id}/environments/#{environment.id}", non_member) delete api("/projects/#{project.id}/environments/#{environment.id}", non_member)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
...@@ -164,7 +164,7 @@ describe API::Environments do ...@@ -164,7 +164,7 @@ describe API::Environments do
end end
it 'returns a 200' do it 'returns a 200' do
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(200)
end end
it 'actually stops the environment' do it 'actually stops the environment' do
...@@ -175,7 +175,7 @@ describe API::Environments do ...@@ -175,7 +175,7 @@ describe API::Environments do
it 'returns a 404 for non existing id' do it 'returns a 404 for non existing id' do
post api("/projects/#{project.id}/environments/12345/stop", user) post api("/projects/#{project.id}/environments/12345/stop", user)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
expect(json_response['message']).to eq('404 Not found') expect(json_response['message']).to eq('404 Not found')
end end
end end
...@@ -184,7 +184,7 @@ describe API::Environments do ...@@ -184,7 +184,7 @@ describe API::Environments do
it 'rejects the request' do it 'rejects the request' do
post api("/projects/#{project.id}/environments/#{environment.id}/stop", non_member) post api("/projects/#{project.id}/environments/#{environment.id}/stop", non_member)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(404)
end end
end end
end end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment