Commit be61adb6 authored by Alessio Caiazza's avatar Alessio Caiazza

Merge branch 'pl-rubocop-have-gitlab-http-status-spec-controllers-4' into 'master'

Add http status cop to all group controller specs

See merge request gitlab-org/gitlab!24211
parents 6ea25b65 1d2fb8cf
...@@ -343,6 +343,8 @@ RSpec/HaveGitlabHttpStatus: ...@@ -343,6 +343,8 @@ RSpec/HaveGitlabHttpStatus:
- 'ee/spec/controllers/*.rb' - 'ee/spec/controllers/*.rb'
- 'spec/controllers/projects/**/*.rb' - 'spec/controllers/projects/**/*.rb'
- 'ee/spec/controllers/projects/**/*.rb' - 'ee/spec/controllers/projects/**/*.rb'
- 'spec/controllers/groups/**/*.rb'
- 'ee/spec/controllers/groups/**/*.rb'
- 'spec/requests/*.rb' - 'spec/requests/*.rb'
- 'ee/spec/requests/*.rb' - 'ee/spec/requests/*.rb'
......
...@@ -32,7 +32,7 @@ describe Groups::AuditEventsController do ...@@ -32,7 +32,7 @@ describe Groups::AuditEventsController do
request request
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index) expect(response).to render_template(:index)
end end
...@@ -87,7 +87,7 @@ describe Groups::AuditEventsController do ...@@ -87,7 +87,7 @@ describe Groups::AuditEventsController do
it 'renders 404' do it 'renders 404' do
request request
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -17,7 +17,7 @@ describe Groups::AutocompleteSourcesController do ...@@ -17,7 +17,7 @@ describe Groups::AutocompleteSourcesController do
it 'returns 200 status' do it 'returns 200 status' do
get :epics, params: { group_id: group } get :epics, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'returns the correct response' do it 'returns the correct response' do
...@@ -41,7 +41,7 @@ describe Groups::AutocompleteSourcesController do ...@@ -41,7 +41,7 @@ describe Groups::AutocompleteSourcesController do
get :milestones, params: { group_id: group } get :milestones, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response.count).to eq(1) expect(json_response.count).to eq(1)
expect(json_response.first).to include( expect(json_response.first).to include(
'iid' => group_milestone.iid, 'title' => group_milestone.title 'iid' => group_milestone.iid, 'title' => group_milestone.title
...@@ -53,7 +53,7 @@ describe Groups::AutocompleteSourcesController do ...@@ -53,7 +53,7 @@ describe Groups::AutocompleteSourcesController do
it 'returns 200 status' do it 'returns 200 status' do
get :commands, params: { group_id: group, type: 'Epic', type_id: epic.iid } get :commands, params: { group_id: group, type: 'Epic', type_id: epic.iid }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'returns the correct response' do it 'returns the correct response' do
......
...@@ -23,7 +23,7 @@ describe Groups::BillingsController do ...@@ -23,7 +23,7 @@ describe Groups::BillingsController do
get :index, params: { group_id: group } get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index) expect(response).to render_template(:index)
end end
...@@ -44,7 +44,7 @@ describe Groups::BillingsController do ...@@ -44,7 +44,7 @@ describe Groups::BillingsController do
get :index, params: { group_id: group.id } get :index, params: { group_id: group.id }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
it 'renders 404 when it is not gitlab.com' do it 'renders 404 when it is not gitlab.com' do
...@@ -54,7 +54,7 @@ describe Groups::BillingsController do ...@@ -54,7 +54,7 @@ describe Groups::BillingsController do
get :index, params: { group_id: group } get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -37,7 +37,7 @@ describe Groups::BoardsController do ...@@ -37,7 +37,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
list_boards format: :json list_boards format: :json
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
end end
...@@ -68,7 +68,7 @@ describe Groups::BoardsController do ...@@ -68,7 +68,7 @@ describe Groups::BoardsController do
list_boards(recent: true) list_boards(recent: true)
expect(response).to have_gitlab_http_status(401) expect(response).to have_gitlab_http_status(:unauthorized)
end end
end end
end end
......
...@@ -42,7 +42,7 @@ describe Groups::ClustersController do ...@@ -42,7 +42,7 @@ describe Groups::ClustersController do
it 'renders not found' do it 'renders not found' do
get :prometheus_proxy, params: prometheus_proxy_params get :prometheus_proxy, params: prometheus_proxy_params
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
context 'with invalid clusterable id' do context 'with invalid clusterable id' do
......
...@@ -45,7 +45,7 @@ describe Groups::ContributionAnalyticsController do ...@@ -45,7 +45,7 @@ describe Groups::ContributionAnalyticsController do
get :show, params: { group_id: group.path } get :show, params: { group_id: group.path }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
context 'unlicensed but we show promotions' do context 'unlicensed but we show promotions' do
...@@ -60,14 +60,14 @@ describe Groups::ContributionAnalyticsController do ...@@ -60,14 +60,14 @@ describe Groups::ContributionAnalyticsController do
get :show, params: { group_id: group.path } get :show, params: { group_id: group.path }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
it 'sets instance variables properly', :aggregate_failures do it 'sets instance variables properly', :aggregate_failures do
get :show, params: { group_id: group.path } get :show, params: { group_id: group.path }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(assigns[:data_collector].users).to match_array([user, user2, user3]) expect(assigns[:data_collector].users).to match_array([user, user2, user3])
expect(assigns[:data_collector].total_events_by_author_count.values.sum).to eq(6) expect(assigns[:data_collector].total_events_by_author_count.values.sum).to eq(6)
......
...@@ -20,7 +20,7 @@ describe Groups::DependencyProxiesController do ...@@ -20,7 +20,7 @@ describe Groups::DependencyProxiesController do
it 'returns 200 and renders the view' do it 'returns 200 and renders the view' do
get :show, params: { group_id: group.to_param } get :show, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('groups/dependency_proxies/show') expect(response).to render_template('groups/dependency_proxies/show')
end end
end end
...@@ -28,7 +28,7 @@ describe Groups::DependencyProxiesController do ...@@ -28,7 +28,7 @@ describe Groups::DependencyProxiesController do
it 'returns 404 when feature is disabled' do it 'returns 404 when feature is disabled' do
get :show, params: { group_id: group.to_param } get :show, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -41,14 +41,14 @@ describe Groups::DependencyProxiesController do ...@@ -41,14 +41,14 @@ describe Groups::DependencyProxiesController do
it 'redirects back to show page' do it 'redirects back to show page' do
put :update, params: update_params put :update, params: update_params
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
it 'returns 404 when feature is disabled' do it 'returns 404 when feature is disabled' do
put :update, params: update_params put :update, params: update_params
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
def update_params def update_params
......
...@@ -40,7 +40,7 @@ describe Groups::DependencyProxyForContainersController do ...@@ -40,7 +40,7 @@ describe Groups::DependencyProxyForContainersController do
it 'proxies status from the remote token request' do it 'proxies status from the remote token request' do
get_manifest get_manifest
expect(response).to have_gitlab_http_status(503) expect(response).to have_gitlab_http_status(:service_unavailable)
expect(response.body).to eq('Service Unavailable') expect(response.body).to eq('Service Unavailable')
end end
end end
...@@ -57,7 +57,7 @@ describe Groups::DependencyProxyForContainersController do ...@@ -57,7 +57,7 @@ describe Groups::DependencyProxyForContainersController do
it 'proxies status from the remote manifest request' do it 'proxies status from the remote manifest request' do
get_manifest get_manifest
expect(response).to have_gitlab_http_status(400) expect(response).to have_gitlab_http_status(:bad_request)
expect(response.body).to be_empty expect(response.body).to be_empty
end end
end end
...@@ -65,7 +65,7 @@ describe Groups::DependencyProxyForContainersController do ...@@ -65,7 +65,7 @@ describe Groups::DependencyProxyForContainersController do
it 'returns 200 with manifest file' do it 'returns 200 with manifest file' do
get_manifest get_manifest
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to eq(manifest) expect(response.body).to eq(manifest)
end end
end end
...@@ -73,7 +73,7 @@ describe Groups::DependencyProxyForContainersController do ...@@ -73,7 +73,7 @@ describe Groups::DependencyProxyForContainersController do
it 'returns 404 when feature is disabled' do it 'returns 404 when feature is disabled' do
get_manifest get_manifest
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
def get_manifest def get_manifest
...@@ -108,7 +108,7 @@ describe Groups::DependencyProxyForContainersController do ...@@ -108,7 +108,7 @@ describe Groups::DependencyProxyForContainersController do
it 'proxies status from the remote blob request' do it 'proxies status from the remote blob request' do
get_blob get_blob
expect(response).to have_gitlab_http_status(400) expect(response).to have_gitlab_http_status(:bad_request)
expect(response.body).to be_empty expect(response.body).to be_empty
end end
end end
...@@ -130,7 +130,7 @@ describe Groups::DependencyProxyForContainersController do ...@@ -130,7 +130,7 @@ describe Groups::DependencyProxyForContainersController do
it 'returns 404 when feature is disabled' do it 'returns 404 when feature is disabled' do
get_blob get_blob
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
def get_blob def get_blob
......
...@@ -25,7 +25,7 @@ describe Groups::EpicIssuesController do ...@@ -25,7 +25,7 @@ describe Groups::EpicIssuesController do
end end
it 'returns 400 status' do it 'returns 400 status' do
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -59,7 +59,7 @@ describe Groups::EpicIssuesController do ...@@ -59,7 +59,7 @@ describe Groups::EpicIssuesController do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -84,7 +84,7 @@ describe Groups::EpicIssuesController do ...@@ -84,7 +84,7 @@ describe Groups::EpicIssuesController do
subject subject
list_service_response = EpicIssues::ListService.new(epic, user).execute list_service_response = EpicIssues::ListService.new(epic, user).execute
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq('message' => nil, 'issuables' => list_service_response.as_json) expect(json_response).to eq('message' => nil, 'issuables' => list_service_response.as_json)
end end
...@@ -97,7 +97,7 @@ describe Groups::EpicIssuesController do ...@@ -97,7 +97,7 @@ describe Groups::EpicIssuesController do
it 'returns correct response for the correct issue reference' do it 'returns correct response for the correct issue reference' do
subject subject
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
it 'does not create a new EpicIssue record' do it 'does not create a new EpicIssue record' do
......
...@@ -22,7 +22,7 @@ describe Groups::EpicLinksController do ...@@ -22,7 +22,7 @@ describe Groups::EpicLinksController do
end end
it 'returns 400 status' do it 'returns 400 status' do
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -50,7 +50,7 @@ describe Groups::EpicLinksController do ...@@ -50,7 +50,7 @@ describe Groups::EpicLinksController do
it 'returns the correct JSON response' do it 'returns the correct JSON response' do
list_service_response = EpicLinks::ListService.new(parent_epic, user).execute list_service_response = EpicLinks::ListService.new(parent_epic, user).execute
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq(list_service_response.as_json) expect(json_response).to eq(list_service_response.as_json)
end end
end end
...@@ -61,7 +61,7 @@ describe Groups::EpicLinksController do ...@@ -61,7 +61,7 @@ describe Groups::EpicLinksController do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -90,7 +90,7 @@ describe Groups::EpicLinksController do ...@@ -90,7 +90,7 @@ describe Groups::EpicLinksController do
subject subject
list_service_response = EpicLinks::ListService.new(parent_epic, user).execute list_service_response = EpicLinks::ListService.new(parent_epic, user).execute
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to eq('message' => nil, 'issuables' => list_service_response.as_json) expect(json_response).to eq('message' => nil, 'issuables' => list_service_response.as_json)
end end
...@@ -103,7 +103,7 @@ describe Groups::EpicLinksController do ...@@ -103,7 +103,7 @@ describe Groups::EpicLinksController do
it 'returns 403 status' do it 'returns 403 status' do
subject subject
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
it 'does not update parent attribute' do it 'does not update parent attribute' do
...@@ -140,7 +140,7 @@ describe Groups::EpicLinksController do ...@@ -140,7 +140,7 @@ describe Groups::EpicLinksController do
it 'returns status 200' do it 'returns status 200' do
subject subject
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'updates the epic position' do it 'updates the epic position' do
...@@ -153,7 +153,7 @@ describe Groups::EpicLinksController do ...@@ -153,7 +153,7 @@ describe Groups::EpicLinksController do
it 'returns status 404' do it 'returns status 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -162,7 +162,7 @@ describe Groups::EpicLinksController do ...@@ -162,7 +162,7 @@ describe Groups::EpicLinksController do
it 'returns status 403' do it 'returns status 403' do
subject subject
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
end end
end end
......
...@@ -66,13 +66,13 @@ describe Groups::Epics::NotesController do ...@@ -66,13 +66,13 @@ describe Groups::Epics::NotesController do
it "returns status 302 for html" do it "returns status 302 for html" do
post :create, params: request_params.merge(format: :html) post :create, params: request_params.merge(format: :html)
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
it "returns status 200 for json" do it "returns status 200 for json" do
post :create, params: request_params post :create, params: request_params
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(parsed_response[:id]).not_to be_nil expect(parsed_response[:id]).not_to be_nil
end end
...@@ -95,7 +95,7 @@ describe Groups::Epics::NotesController do ...@@ -95,7 +95,7 @@ describe Groups::Epics::NotesController do
it "creates reply note for discussion" do it "creates reply note for discussion" do
post :create, params: request_params post :create, params: request_params
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(parsed_response[:errors]).to be_nil expect(parsed_response[:errors]).to be_nil
end end
end end
...@@ -143,7 +143,7 @@ describe Groups::Epics::NotesController do ...@@ -143,7 +143,7 @@ describe Groups::Epics::NotesController do
it "returns status 200" do it "returns status 200" do
delete :destroy, params: request_params delete :destroy, params: request_params
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it "deletes the note" do it "deletes the note" do
...@@ -159,7 +159,7 @@ describe Groups::Epics::NotesController do ...@@ -159,7 +159,7 @@ describe Groups::Epics::NotesController do
it "returns status 404" do it "returns status 404" do
delete :destroy, params: request_params delete :destroy, params: request_params
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -183,7 +183,7 @@ describe Groups::Epics::NotesController do ...@@ -183,7 +183,7 @@ describe Groups::Epics::NotesController do
post(:toggle_award_emoji, params: request_params.merge(name: "thumbsup")) post(:toggle_award_emoji, params: 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_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it "removes the already awarded emoji" do it "removes the already awarded emoji" do
...@@ -193,7 +193,7 @@ describe Groups::Epics::NotesController do ...@@ -193,7 +193,7 @@ describe Groups::Epics::NotesController do
post(:toggle_award_emoji, params: request_params.merge(name: "thumbsup")) post(:toggle_award_emoji, params: request_params.merge(name: "thumbsup"))
end.to change { AwardEmoji.count }.by(-1) end.to change { AwardEmoji.count }.by(-1)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
...@@ -17,7 +17,7 @@ describe Groups::EpicsController do ...@@ -17,7 +17,7 @@ describe Groups::EpicsController do
it 'returns 404 status' do it 'returns 404 status' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -56,7 +56,7 @@ describe Groups::EpicsController do ...@@ -56,7 +56,7 @@ describe Groups::EpicsController do
it "returns index" do it "returns index" do
get :index, params: { group_id: group } get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
context 'when there is no logged in user' do context 'when there is no logged in user' do
...@@ -67,7 +67,7 @@ describe Groups::EpicsController do ...@@ -67,7 +67,7 @@ describe Groups::EpicsController do
get :index, params: { group_id: group, sort: 'start_date_asc' } get :index, params: { group_id: group, sort: 'start_date_asc' }
expect(cookies['epic_sort']).to eq('start_date_asc') expect(cookies['epic_sort']).to eq('start_date_asc')
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -77,7 +77,7 @@ describe Groups::EpicsController do ...@@ -77,7 +77,7 @@ describe Groups::EpicsController do
get :index, params: { group_id: group, sort: 'start_date_asc' } get :index, params: { group_id: group, sort: 'start_date_asc' }
expect(user.user_preference.epics_sort).to eq('start_date_asc') expect(user.user_preference.epics_sort).to eq('start_date_asc')
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -88,7 +88,7 @@ describe Groups::EpicsController do ...@@ -88,7 +88,7 @@ describe Groups::EpicsController do
get :index, params: { group_id: group, sort: 'start_date_asc' } get :index, params: { group_id: group, sort: 'start_date_asc' }
expect(user.reload.user_preference.epics_sort).to eq('start_date_asc') expect(user.reload.user_preference.epics_sort).to eq('start_date_asc')
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
...@@ -110,7 +110,7 @@ describe Groups::EpicsController do ...@@ -110,7 +110,7 @@ describe Groups::EpicsController do
get :index, params: { group_id: group, page: last_page.to_param } get :index, params: { group_id: group, page: last_page.to_param }
expect(assigns(:epics).current_page).to eq(last_page) expect(assigns(:epics).current_page).to eq(last_page)
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it_behaves_like 'disabled when using an external authorization service' do it_behaves_like 'disabled when using an external authorization service' do
...@@ -216,7 +216,7 @@ describe Groups::EpicsController do ...@@ -216,7 +216,7 @@ describe Groups::EpicsController do
it 'the link to the issue is included' do it 'the link to the issue is included' do
get :discussions, params: { group_id: group, id: epic.to_param } get :discussions, params: { group_id: group, id: epic.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response.size).to eq(1) expect(json_response.size).to eq(1)
discussion = json_response[0] discussion = json_response[0]
notes = discussion["notes"] notes = discussion["notes"]
...@@ -266,7 +266,7 @@ describe Groups::EpicsController do ...@@ -266,7 +266,7 @@ describe Groups::EpicsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
show_epic show_epic
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'text/html' expect(response.content_type).to eq 'text/html'
end end
end end
...@@ -285,7 +285,7 @@ describe Groups::EpicsController do ...@@ -285,7 +285,7 @@ describe Groups::EpicsController do
group.add_developer(user) group.add_developer(user)
show_epic(:json) show_epic(:json)
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('entities/epic', dir: 'ee') expect(response).to match_response_schema('entities/epic', dir: 'ee')
end end
...@@ -293,7 +293,7 @@ describe Groups::EpicsController do ...@@ -293,7 +293,7 @@ describe Groups::EpicsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
show_epic(:json) show_epic(:json)
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
end end
...@@ -384,7 +384,7 @@ describe Groups::EpicsController do ...@@ -384,7 +384,7 @@ describe Groups::EpicsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
subject subject
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -409,7 +409,7 @@ describe Groups::EpicsController do ...@@ -409,7 +409,7 @@ describe Groups::EpicsController do
it 'returns 200 response' do it 'returns 200 response' do
subject subject
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'creates a new epic' do it 'creates a new epic' do
...@@ -435,7 +435,7 @@ describe Groups::EpicsController do ...@@ -435,7 +435,7 @@ describe Groups::EpicsController do
end end
it 'returns 422 response' do it 'returns 422 response' do
expect(response).to have_gitlab_http_status(422) expect(response).to have_gitlab_http_status(:unprocessable_entity)
end end
it 'does not create a new epic' do it 'does not create a new epic' do
...@@ -449,7 +449,7 @@ describe Groups::EpicsController do ...@@ -449,7 +449,7 @@ describe Groups::EpicsController do
group.add_guest(user) group.add_guest(user)
subject subject
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -463,14 +463,14 @@ describe Groups::EpicsController do ...@@ -463,14 +463,14 @@ describe Groups::EpicsController do
group.add_developer(user) group.add_developer(user)
delete :destroy, params: { group_id: group, id: epic.to_param, destroy_confirm: true } delete :destroy, params: { group_id: group, id: epic.to_param, destroy_confirm: true }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
it "deletes the epic" do it "deletes the epic" do
group.add_owner(user) group.add_owner(user)
delete :destroy, params: { group_id: group, id: epic.to_param, destroy_confirm: true } delete :destroy, params: { group_id: group, id: epic.to_param, destroy_confirm: true }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(controller).to set_flash[:notice].to(/The epic was successfully deleted\./) expect(controller).to set_flash[:notice].to(/The epic was successfully deleted\./)
end end
end end
......
...@@ -72,7 +72,7 @@ describe Groups::GroupMembersController do ...@@ -72,7 +72,7 @@ describe Groups::GroupMembersController do
}, },
format: :js format: :js
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
......
...@@ -88,7 +88,7 @@ describe GroupsController do ...@@ -88,7 +88,7 @@ describe GroupsController do
it 'prevents access to group resources' do it 'prevents access to group resources' do
get :show, params: { id: group } get :show, params: { id: group }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response.location).to match(/groups\/#{group.to_param}\/-\/saml\/sso\?redirect=.+&token=/) expect(response.location).to match(/groups\/#{group.to_param}\/-\/saml\/sso\?redirect=.+&token=/)
end end
end end
...@@ -103,7 +103,7 @@ describe GroupsController do ...@@ -103,7 +103,7 @@ describe GroupsController do
it 'allows access to group resources' do it 'allows access to group resources' do
get :show, params: { id: group } get :show, params: { id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
......
...@@ -20,7 +20,7 @@ describe Groups::HooksController do ...@@ -20,7 +20,7 @@ describe Groups::HooksController do
it 'is successfull' do it 'is successfull' do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -43,7 +43,7 @@ describe Groups::HooksController do ...@@ -43,7 +43,7 @@ describe Groups::HooksController do
post :create, params: { group_id: group.to_param, hook: hook_params } post :create, params: { group_id: group.to_param, hook: hook_params }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(group.hooks.size).to eq(1) expect(group.hooks.size).to eq(1)
expect(group.hooks.first).to have_attributes(hook_params) expect(group.hooks.first).to have_attributes(hook_params)
end end
...@@ -55,7 +55,7 @@ describe Groups::HooksController do ...@@ -55,7 +55,7 @@ describe Groups::HooksController do
it 'is successfull' do it 'is successfull' do
get :edit, params: { group_id: group.to_param, id: hook } get :edit, params: { group_id: group.to_param, id: hook }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:edit) expect(response).to render_template(:edit)
expect(group.hooks.size).to eq(1) expect(group.hooks.size).to eq(1)
end end
...@@ -85,7 +85,7 @@ describe Groups::HooksController do ...@@ -85,7 +85,7 @@ describe Groups::HooksController do
it 'is successfull' do it 'is successfull' do
patch :update, params: { group_id: group.to_param, id: hook, hook: hook_params } patch :update, params: { group_id: group.to_param, id: hook, hook: hook_params }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(response).to redirect_to(group_hooks_path(group)) expect(response).to redirect_to(group_hooks_path(group))
expect(group.hooks.size).to eq(1) expect(group.hooks.size).to eq(1)
expect(group.hooks.first).to have_attributes(hook_params) expect(group.hooks.first).to have_attributes(hook_params)
...@@ -102,7 +102,7 @@ describe Groups::HooksController do ...@@ -102,7 +102,7 @@ describe Groups::HooksController do
it 'renders "edit" template' do it 'renders "edit" template' do
patch :update, params: { group_id: group.to_param, id: hook, hook: hook_params } patch :update, params: { group_id: group.to_param, id: hook, hook: hook_params }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:edit) expect(response).to render_template(:edit)
expect(group.hooks.size).to eq(1) expect(group.hooks.size).to eq(1)
expect(group.hooks.first).not_to have_attributes(hook_params) expect(group.hooks.first).not_to have_attributes(hook_params)
...@@ -119,7 +119,7 @@ describe Groups::HooksController do ...@@ -119,7 +119,7 @@ describe Groups::HooksController do
post :test, params: { group_id: group.to_param, id: hook } post :test, params: { group_id: group.to_param, id: hook }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(flash[:alert]).to eq('Hook execution failed. Ensure the group has a project with commits.') expect(flash[:alert]).to eq('Hook execution failed. Ensure the group has a project with commits.')
end end
end end
...@@ -135,7 +135,7 @@ describe Groups::HooksController do ...@@ -135,7 +135,7 @@ describe Groups::HooksController do
post :test, params: { group_id: group.to_param, id: hook } post :test, params: { group_id: group.to_param, id: hook }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(flash[:notice]).to eq('Hook executed successfully: HTTP 200') expect(flash[:notice]).to eq('Hook executed successfully: HTTP 200')
end end
end end
...@@ -150,7 +150,7 @@ describe Groups::HooksController do ...@@ -150,7 +150,7 @@ describe Groups::HooksController do
post :test, params: { group_id: group.to_param, id: hook, trigger: trigger } post :test, params: { group_id: group.to_param, id: hook, trigger: trigger }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(flash[:notice]).to eq('Hook executed successfully: HTTP 200') expect(flash[:notice]).to eq('Hook executed successfully: HTTP 200')
end end
end end
...@@ -167,7 +167,7 @@ describe Groups::HooksController do ...@@ -167,7 +167,7 @@ describe Groups::HooksController do
it 'renders a 404' do it 'renders a 404' do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -23,7 +23,7 @@ describe Groups::InsightsController do ...@@ -23,7 +23,7 @@ describe Groups::InsightsController do
it 'returns 404 status' do it 'returns 404 status' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -31,7 +31,7 @@ describe Groups::InsightsController do ...@@ -31,7 +31,7 @@ describe Groups::InsightsController do
it 'returns 200 status' do it 'returns 200 status' do
subject subject
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
......
...@@ -18,7 +18,7 @@ describe Groups::IssuesAnalyticsController do ...@@ -18,7 +18,7 @@ describe Groups::IssuesAnalyticsController do
it 'renders 404' do it 'renders 404' do
get :show, params: { group_id: group.to_param } get :show, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -32,7 +32,7 @@ describe Groups::IssuesAnalyticsController do ...@@ -32,7 +32,7 @@ describe Groups::IssuesAnalyticsController do
it 'renders 404' do it 'renders 404' do
get :show, params: { group_id: group.to_param } get :show, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -31,7 +31,7 @@ describe Groups::IssuesController do ...@@ -31,7 +31,7 @@ describe Groups::IssuesController do
it 'returns 404 status' do it 'returns 404 status' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -35,7 +35,7 @@ describe Groups::MergeRequestsController do ...@@ -35,7 +35,7 @@ describe Groups::MergeRequestsController do
it 'returns 404 status' do it 'returns 404 status' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -22,7 +22,7 @@ describe Groups::SamlProvidersController do ...@@ -22,7 +22,7 @@ describe Groups::SamlProvidersController do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -110,7 +110,7 @@ describe Groups::SamlProvidersController do ...@@ -110,7 +110,7 @@ describe Groups::SamlProvidersController do
subject subject
expect(response).to have_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -23,17 +23,17 @@ describe Groups::Security::DashboardController do ...@@ -23,17 +23,17 @@ describe Groups::Security::DashboardController do
group.add_developer(user) group.add_developer(user)
end end
it { is_expected.to have_gitlab_http_status(200) } it { is_expected.to have_gitlab_http_status(:ok) }
end end
context 'when user is not allowed to access group security dashboard' do context 'when user is not allowed to access group security dashboard' do
it { is_expected.to have_gitlab_http_status(200) } it { is_expected.to have_gitlab_http_status(:ok) }
it { is_expected.to render_template(:unavailable) } it { is_expected.to render_template(:unavailable) }
end end
end end
context 'when security dashboard feature is disabled' do context 'when security dashboard feature is disabled' do
it { is_expected.to have_gitlab_http_status(200) } it { is_expected.to have_gitlab_http_status(:ok) }
it { is_expected.to render_template(:unavailable) } it { is_expected.to render_template(:unavailable) }
end end
end end
......
...@@ -90,7 +90,7 @@ describe Groups::Security::VulnerabilityFindingsController do ...@@ -90,7 +90,7 @@ describe Groups::Security::VulnerabilityFindingsController do
subject subject
end end
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response['total']).to eq({ '2018-11-12' => 2 }) expect(json_response['total']).to eq({ '2018-11-12' => 2 })
expect(json_response['critical']).to eq({ '2018-11-12' => 1 }) expect(json_response['critical']).to eq({ '2018-11-12' => 1 })
expect(json_response['low']).to eq({ '2018-11-12' => 1 }) expect(json_response['low']).to eq({ '2018-11-12' => 1 })
......
...@@ -36,7 +36,7 @@ describe Groups::Security::VulnerableProjectsController do ...@@ -36,7 +36,7 @@ describe Groups::Security::VulnerableProjectsController do
subject subject
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response.count).to be(1) expect(json_response.count).to be(1)
expect(json_response.first['id']).to eq(vulnerable_project.id) expect(json_response.first['id']).to eq(vulnerable_project.id)
expect(json_response.first['full_path']).to eq(project_path(vulnerable_project)) expect(json_response.first['full_path']).to eq(project_path(vulnerable_project))
...@@ -53,7 +53,7 @@ describe Groups::Security::VulnerableProjectsController do ...@@ -53,7 +53,7 @@ describe Groups::Security::VulnerableProjectsController do
subject subject
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_empty expect(json_response).to be_empty
end end
end end
......
...@@ -18,13 +18,13 @@ describe Groups::SsoController do ...@@ -18,13 +18,13 @@ describe Groups::SsoController do
it 'has status 200' do it 'has status 200' do
get :saml, params: { group_id: group } get :saml, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'malicious redirect parameter falls back to group_path' do it 'malicious redirect parameter falls back to group_path' do
get :saml, params: { group_id: group, redirect: '///malicious-url' } get :saml, params: { group_id: group, redirect: '///malicious-url' }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(assigns[:redirect_path]).to eq(group_path(group)) expect(assigns[:redirect_path]).to eq(group_path(group))
end end
...@@ -50,7 +50,7 @@ describe Groups::SsoController do ...@@ -50,7 +50,7 @@ describe Groups::SsoController do
it 'renders 404' do it 'renders 404' do
get :saml, params: { group_id: group } get :saml, params: { group_id: group }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
it 'still allows account unlinking' do it 'still allows account unlinking' do
...@@ -88,7 +88,7 @@ describe Groups::SsoController do ...@@ -88,7 +88,7 @@ describe Groups::SsoController do
it 'renders 404' do it 'renders 404' do
get :saml, params: { group_id: group } get :saml, params: { group_id: group }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -115,7 +115,7 @@ describe Groups::SsoController do ...@@ -115,7 +115,7 @@ describe Groups::SsoController do
it 'renders 404' do it 'renders 404' do
get :saml, params: { group_id: 'not-a-group' } get :saml, params: { group_id: 'not-a-group' }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
context 'when user is not signed in' do context 'when user is not signed in' do
...@@ -147,7 +147,7 @@ describe Groups::SsoController do ...@@ -147,7 +147,7 @@ describe Groups::SsoController do
let(:oauth_data) { { "info" => { name: 'Test', email: 'testuser@email.com' } } } let(:oauth_data) { { "info" => { name: 'Test', email: 'testuser@email.com' } } }
it 'has status 200' do it 'has status 200' do
expect(subject).to have_gitlab_http_status(200) expect(subject).to have_gitlab_http_status(:ok)
end end
it 'suggests first available username automatically' do it 'suggests first available username automatically' do
...@@ -162,13 +162,13 @@ describe Groups::SsoController do ...@@ -162,13 +162,13 @@ describe Groups::SsoController do
let(:oauth_group_id) { group.id + 1 } let(:oauth_group_id) { group.id + 1 }
it 'renders 404' do it 'renders 404' do
expect(subject).to have_gitlab_http_status(404) expect(subject).to have_gitlab_http_status(:not_found)
end end
end end
end end
it 'renders 404' do it 'renders 404' do
expect(subject).to have_gitlab_http_status(404) expect(subject).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -178,7 +178,7 @@ describe Groups::SsoController do ...@@ -178,7 +178,7 @@ describe Groups::SsoController do
end end
it 'renders 404' do it 'renders 404' do
expect(subject).to have_gitlab_http_status(404) expect(subject).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -25,6 +25,6 @@ describe Groups::AvatarsController do ...@@ -25,6 +25,6 @@ describe Groups::AvatarsController do
delete :destroy, params: { group_id: group } delete :destroy, params: { group_id: group }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -33,7 +33,7 @@ describe Groups::BoardsController do ...@@ -33,7 +33,7 @@ describe Groups::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_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'text/html' expect(response.content_type).to eq 'text/html'
end end
end end
...@@ -76,7 +76,7 @@ describe Groups::BoardsController do ...@@ -76,7 +76,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
list_boards format: :json list_boards format: :json
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
end end
...@@ -111,7 +111,7 @@ describe Groups::BoardsController do ...@@ -111,7 +111,7 @@ describe Groups::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_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'text/html' expect(response.content_type).to eq 'text/html'
end end
end end
...@@ -148,7 +148,7 @@ describe Groups::BoardsController do ...@@ -148,7 +148,7 @@ describe Groups::BoardsController do
it 'returns a not found 404 response' do it 'returns a not found 404 response' do
read_board board: board, format: :json read_board board: board, format: :json
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
end end
...@@ -160,7 +160,7 @@ describe Groups::BoardsController do ...@@ -160,7 +160,7 @@ describe Groups::BoardsController do
read_board board: another_board read_board board: another_board
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
......
...@@ -142,7 +142,7 @@ describe Groups::ChildrenController do ...@@ -142,7 +142,7 @@ describe Groups::ChildrenController do
get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json
expect(response).to have_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'returns an array with one element when only one result is matched' do it 'returns an array with one element when only one result is matched' do
...@@ -185,7 +185,7 @@ describe Groups::ChildrenController do ...@@ -185,7 +185,7 @@ describe Groups::ChildrenController do
get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 3 }, format: :json get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 3 }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
it 'includes pagination headers' do it 'includes pagination headers' do
...@@ -316,7 +316,7 @@ describe Groups::ChildrenController do ...@@ -316,7 +316,7 @@ describe Groups::ChildrenController do
it 'correctly calculates the counts' do it 'correctly calculates the counts' do
get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
...@@ -328,7 +328,7 @@ describe Groups::ChildrenController do ...@@ -328,7 +328,7 @@ describe Groups::ChildrenController do
get :index, params: { group_id: group }, format: :json get :index, params: { group_id: group }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
......
...@@ -43,7 +43,7 @@ describe Groups::Clusters::ApplicationsController do ...@@ -43,7 +43,7 @@ describe Groups::Clusters::ApplicationsController do
expect(ClusterInstallAppWorker).to receive(:perform_async).with(application, anything).once expect(ClusterInstallAppWorker).to receive(:perform_async).with(application, anything).once
expect { subject }.to change { current_application.count } expect { subject }.to change { current_application.count }
expect(response).to have_http_status(:no_content) expect(response).to have_gitlab_http_status(:no_content)
expect(cluster.application_helm).to be_scheduled expect(cluster.application_helm).to be_scheduled
end end
...@@ -54,7 +54,7 @@ describe Groups::Clusters::ApplicationsController do ...@@ -54,7 +54,7 @@ describe Groups::Clusters::ApplicationsController do
it 'return 404' do it 'return 404' do
expect { subject }.not_to change { current_application.count } expect { subject }.not_to change { current_application.count }
expect(response).to have_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -62,7 +62,7 @@ describe Groups::Clusters::ApplicationsController do ...@@ -62,7 +62,7 @@ describe Groups::Clusters::ApplicationsController do
let(:application) { 'unkwnown-app' } let(:application) { 'unkwnown-app' }
it 'return 404' do it 'return 404' do
is_expected.to have_http_status(:not_found) is_expected.to have_gitlab_http_status(:not_found)
end end
end end
...@@ -72,7 +72,7 @@ describe Groups::Clusters::ApplicationsController do ...@@ -72,7 +72,7 @@ describe Groups::Clusters::ApplicationsController do
end end
it 'returns 400' do it 'returns 400' do
is_expected.to have_http_status(:bad_request) is_expected.to have_gitlab_http_status(:bad_request)
end end
end end
end end
...@@ -107,7 +107,7 @@ describe Groups::Clusters::ApplicationsController do ...@@ -107,7 +107,7 @@ describe Groups::Clusters::ApplicationsController do
it "schedules an application update" do it "schedules an application update" do
expect(ClusterPatchAppWorker).to receive(:perform_async).with(application.name, anything).once expect(ClusterPatchAppWorker).to receive(:perform_async).with(application.name, anything).once
is_expected.to have_http_status(:no_content) is_expected.to have_gitlab_http_status(:no_content)
expect(cluster.application_cert_manager).to be_scheduled expect(cluster.application_cert_manager).to be_scheduled
end end
...@@ -118,13 +118,13 @@ describe Groups::Clusters::ApplicationsController do ...@@ -118,13 +118,13 @@ describe Groups::Clusters::ApplicationsController do
cluster.destroy! cluster.destroy!
end end
it { is_expected.to have_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'when application is unknown' do context 'when application is unknown' do
let(:application_name) { 'unkwnown-app' } let(:application_name) { 'unkwnown-app' }
it { is_expected.to have_http_status(:not_found) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'when application is already scheduled' do context 'when application is already scheduled' do
...@@ -132,7 +132,7 @@ describe Groups::Clusters::ApplicationsController do ...@@ -132,7 +132,7 @@ describe Groups::Clusters::ApplicationsController do
application.make_scheduled! application.make_scheduled!
end end
it { is_expected.to have_http_status(:bad_request) } it { is_expected.to have_gitlab_http_status(:bad_request) }
end end
end end
......
...@@ -654,7 +654,7 @@ describe Groups::ClustersController do ...@@ -654,7 +654,7 @@ describe Groups::ClustersController do
go(format: :json) go(format: :json)
cluster.reload cluster.reload
expect(response).to have_http_status(:no_content) expect(response).to have_gitlab_http_status(:no_content)
expect(cluster.enabled).to be_falsey expect(cluster.enabled).to be_falsey
expect(cluster.name).to eq('my-new-cluster-name') expect(cluster.name).to eq('my-new-cluster-name')
expect(cluster).not_to be_managed expect(cluster).not_to be_managed
...@@ -674,7 +674,7 @@ describe Groups::ClustersController do ...@@ -674,7 +674,7 @@ describe Groups::ClustersController do
it 'rejects changes' do it 'rejects changes' do
go(format: :json) go(format: :json)
expect(response).to have_http_status(:bad_request) expect(response).to have_gitlab_http_status(:bad_request)
end end
end end
end end
......
...@@ -100,7 +100,7 @@ describe Groups::GroupLinksController do ...@@ -100,7 +100,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -113,7 +113,7 @@ describe Groups::GroupLinksController do ...@@ -113,7 +113,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -126,7 +126,7 @@ describe Groups::GroupLinksController do ...@@ -126,7 +126,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -168,7 +168,7 @@ describe Groups::GroupLinksController do ...@@ -168,7 +168,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -180,7 +180,7 @@ describe Groups::GroupLinksController do ...@@ -180,7 +180,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -210,7 +210,7 @@ describe Groups::GroupLinksController do ...@@ -210,7 +210,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -222,7 +222,7 @@ describe Groups::GroupLinksController do ...@@ -222,7 +222,7 @@ describe Groups::GroupLinksController do
it 'renders 404' do it 'renders 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -13,7 +13,7 @@ describe Groups::GroupMembersController do ...@@ -13,7 +13,7 @@ describe Groups::GroupMembersController do
it 'renders index with 200 status code' do it 'renders index with 200 status code' do
get :index, params: { group_id: group } get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index) expect(response).to render_template(:index)
end end
...@@ -105,7 +105,7 @@ describe Groups::GroupMembersController do ...@@ -105,7 +105,7 @@ describe Groups::GroupMembersController do
access_level: Gitlab::Access::GUEST access_level: Gitlab::Access::GUEST
} }
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
expect(group.users).not_to include group_user expect(group.users).not_to include group_user
end end
end end
...@@ -173,7 +173,7 @@ describe Groups::GroupMembersController do ...@@ -173,7 +173,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
delete :destroy, params: { group_id: group, id: 42 } delete :destroy, params: { group_id: group, id: 42 }
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
end end
...@@ -186,7 +186,7 @@ describe Groups::GroupMembersController do ...@@ -186,7 +186,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
delete :destroy, params: { group_id: group, id: member } delete :destroy, params: { group_id: group, id: member }
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
expect(group.members).to include member expect(group.members).to include member
end end
end end
...@@ -223,7 +223,7 @@ describe Groups::GroupMembersController do ...@@ -223,7 +223,7 @@ describe Groups::GroupMembersController do
it 'returns 404' do it 'returns 404' do
delete :leave, params: { group_id: group } delete :leave, params: { group_id: group }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -244,7 +244,7 @@ describe Groups::GroupMembersController do ...@@ -244,7 +244,7 @@ describe Groups::GroupMembersController do
it 'supports json request' do it 'supports json request' do
delete :leave, params: { group_id: group }, format: :json delete :leave, params: { group_id: group }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
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
...@@ -257,7 +257,7 @@ describe Groups::GroupMembersController do ...@@ -257,7 +257,7 @@ describe Groups::GroupMembersController do
it 'cannot removes himself from the group' do it 'cannot removes himself from the group' do
delete :leave, params: { group_id: group } delete :leave, params: { group_id: group }
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
end end
...@@ -304,7 +304,7 @@ describe Groups::GroupMembersController do ...@@ -304,7 +304,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
post :approve_access_request, params: { group_id: group, id: 42 } post :approve_access_request, params: { group_id: group, id: 42 }
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
end end
end end
...@@ -317,7 +317,7 @@ describe Groups::GroupMembersController do ...@@ -317,7 +317,7 @@ describe Groups::GroupMembersController do
it 'returns 403' do it 'returns 403' do
post :approve_access_request, params: { group_id: group, id: member } post :approve_access_request, params: { group_id: group, id: member }
expect(response).to have_gitlab_http_status(403) expect(response).to have_gitlab_http_status(:forbidden)
expect(group.members).not_to include member expect(group.members).not_to include member
end end
end end
...@@ -348,7 +348,7 @@ describe Groups::GroupMembersController do ...@@ -348,7 +348,7 @@ describe Groups::GroupMembersController do
it 'is successful' do it 'is successful' do
get :index, params: { group_id: group } get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -356,7 +356,7 @@ describe Groups::GroupMembersController do ...@@ -356,7 +356,7 @@ describe Groups::GroupMembersController do
it 'is successful' do it 'is successful' do
post :create, params: { group_id: group, users: user, access_level: Gitlab::Access::GUEST } post :create, params: { group_id: group, users: user, access_level: Gitlab::Access::GUEST }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -370,7 +370,7 @@ describe Groups::GroupMembersController do ...@@ -370,7 +370,7 @@ describe Groups::GroupMembersController do
}, },
format: :js format: :js
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -378,7 +378,7 @@ describe Groups::GroupMembersController do ...@@ -378,7 +378,7 @@ describe Groups::GroupMembersController do
it 'is successful' do it 'is successful' do
delete :destroy, params: { group_id: group, id: membership } delete :destroy, params: { group_id: group, id: membership }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -388,7 +388,7 @@ describe Groups::GroupMembersController do ...@@ -388,7 +388,7 @@ describe Groups::GroupMembersController do
post :request_access, params: { group_id: group } post :request_access, params: { group_id: group }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -397,7 +397,7 @@ describe Groups::GroupMembersController do ...@@ -397,7 +397,7 @@ describe Groups::GroupMembersController do
access_request = create(:group_member, :access_request, group: group) access_request = create(:group_member, :access_request, group: group)
post :approve_access_request, params: { group_id: group, id: access_request } post :approve_access_request, params: { group_id: group, id: access_request }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -407,7 +407,7 @@ describe Groups::GroupMembersController do ...@@ -407,7 +407,7 @@ describe Groups::GroupMembersController do
delete :leave, params: { group_id: group } delete :leave, params: { group_id: group }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
...@@ -415,7 +415,7 @@ describe Groups::GroupMembersController do ...@@ -415,7 +415,7 @@ describe Groups::GroupMembersController do
it 'is successful' do it 'is successful' do
post :resend_invite, params: { group_id: group, id: membership } post :resend_invite, params: { group_id: group, id: membership }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
end end
end end
end end
......
...@@ -53,7 +53,7 @@ describe Groups::LabelsController do ...@@ -53,7 +53,7 @@ describe Groups::LabelsController do
post :toggle_subscription, params: { group_id: group.to_param, id: label.to_param } post :toggle_subscription, params: { group_id: group.to_param, id: label.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
...@@ -42,7 +42,7 @@ describe Groups::MilestonesController do ...@@ -42,7 +42,7 @@ describe Groups::MilestonesController do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include(milestone.title) expect(response.body).to include(milestone.title)
end end
...@@ -74,7 +74,7 @@ describe Groups::MilestonesController do ...@@ -74,7 +74,7 @@ describe Groups::MilestonesController do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include(milestone.title) expect(response.body).to include(milestone.title)
end end
end end
...@@ -84,7 +84,7 @@ describe Groups::MilestonesController do ...@@ -84,7 +84,7 @@ describe Groups::MilestonesController do
it 'does not return milestone' do it 'does not return milestone' do
get :index, params: { group_id: public_group.to_param } get :index, params: { group_id: public_group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).not_to include(private_milestone.title) expect(response.body).not_to include(private_milestone.title)
end end
end end
...@@ -125,7 +125,7 @@ describe Groups::MilestonesController do ...@@ -125,7 +125,7 @@ describe Groups::MilestonesController do
it 'returns the milestone' do it 'returns the milestone' do
get :index, params: { group_id: public_group.to_param } get :index, params: { group_id: public_group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include(private_milestone.title) expect(response.body).to include(private_milestone.title)
end end
end end
...@@ -141,7 +141,7 @@ describe Groups::MilestonesController do ...@@ -141,7 +141,7 @@ describe Groups::MilestonesController do
it 'shows subgroup milestones that user has access to' do it 'shows subgroup milestones that user has access to' do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include(group_milestone.title) expect(response.body).to include(group_milestone.title)
expect(response.body).to include(sub_project_milestone.title) expect(response.body).to include(sub_project_milestone.title)
expect(response.body).to include(subgroup_milestone.title) expect(response.body).to include(subgroup_milestone.title)
...@@ -157,7 +157,7 @@ describe Groups::MilestonesController do ...@@ -157,7 +157,7 @@ describe Groups::MilestonesController do
it 'does not show subgroup milestones' do it 'does not show subgroup milestones' do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include(group_milestone.title) expect(response.body).to include(group_milestone.title)
expect(response.body).not_to include(sub_project_milestone.title) expect(response.body).not_to include(sub_project_milestone.title)
expect(response.body).not_to include(subgroup_milestone.title) expect(response.body).not_to include(subgroup_milestone.title)
...@@ -179,7 +179,7 @@ describe Groups::MilestonesController do ...@@ -179,7 +179,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_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response.content_type).to eq 'application/json' expect(response.content_type).to eq 'application/json'
end end
...@@ -330,7 +330,7 @@ describe Groups::MilestonesController do ...@@ -330,7 +330,7 @@ describe Groups::MilestonesController do
it 'does not redirect' do it 'does not redirect' do
get :index, params: { group_id: group.to_param } get :index, params: { group_id: group.to_param }
expect(response).not_to have_gitlab_http_status(301) expect(response).not_to have_gitlab_http_status(:moved_permanently)
end end
end end
...@@ -349,7 +349,7 @@ describe Groups::MilestonesController do ...@@ -349,7 +349,7 @@ describe Groups::MilestonesController do
it 'does not redirect' do it 'does not redirect' do
get :show, params: { group_id: group.to_param, id: title } get :show, params: { group_id: group.to_param, id: title }
expect(response).not_to have_gitlab_http_status(301) expect(response).not_to have_gitlab_http_status(:moved_permanently)
end end
end end
...@@ -439,7 +439,7 @@ describe Groups::MilestonesController do ...@@ -439,7 +439,7 @@ describe Groups::MilestonesController do
milestone: { title: title } milestone: { title: title }
} }
expect(response).not_to have_gitlab_http_status(404) expect(response).not_to have_gitlab_http_status(:not_found)
end end
it 'does not redirect to the correct casing' do it 'does not redirect to the correct casing' do
...@@ -449,7 +449,7 @@ describe Groups::MilestonesController do ...@@ -449,7 +449,7 @@ describe Groups::MilestonesController do
milestone: { title: title } milestone: { title: title }
} }
expect(response).not_to have_gitlab_http_status(301) expect(response).not_to have_gitlab_http_status(:moved_permanently)
end end
end end
...@@ -463,7 +463,7 @@ describe Groups::MilestonesController do ...@@ -463,7 +463,7 @@ describe Groups::MilestonesController do
milestone: { title: title } milestone: { title: title }
} }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
......
...@@ -21,7 +21,7 @@ describe Groups::RunnersController do ...@@ -21,7 +21,7 @@ describe Groups::RunnersController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, params: { group_id: group, id: runner } get :show, params: { group_id: group, id: runner }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
end end
...@@ -34,7 +34,7 @@ describe Groups::RunnersController do ...@@ -34,7 +34,7 @@ describe Groups::RunnersController do
it 'renders a 404' do it 'renders a 404' do
get :show, params: { group_id: group, id: runner } get :show, params: { group_id: group, id: runner }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -48,7 +48,7 @@ describe Groups::RunnersController do ...@@ -48,7 +48,7 @@ describe Groups::RunnersController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :edit, params: { group_id: group, id: runner } get :edit, params: { group_id: group, id: runner }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:edit) expect(response).to render_template(:edit)
end end
end end
...@@ -61,7 +61,7 @@ describe Groups::RunnersController do ...@@ -61,7 +61,7 @@ describe Groups::RunnersController do
it 'renders a 404' do it 'renders a 404' do
get :edit, params: { group_id: group, id: runner } get :edit, params: { group_id: group, id: runner }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -79,7 +79,7 @@ describe Groups::RunnersController do ...@@ -79,7 +79,7 @@ describe Groups::RunnersController do
post :update, params: params.merge(runner: { description: new_desc } ) post :update, params: params.merge(runner: { description: new_desc } )
end.to change { runner.ensure_runner_queue_value } end.to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(runner.reload.description).to eq(new_desc) expect(runner.reload.description).to eq(new_desc)
end end
end end
...@@ -96,7 +96,7 @@ describe Groups::RunnersController do ...@@ -96,7 +96,7 @@ describe Groups::RunnersController do
post :update, params: params.merge(runner: { description: old_desc.swapcase } ) post :update, params: params.merge(runner: { description: old_desc.swapcase } )
end.not_to change { runner.ensure_runner_queue_value } end.not_to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(runner.reload.description).to eq(old_desc) expect(runner.reload.description).to eq(old_desc)
end end
end end
...@@ -111,7 +111,7 @@ describe Groups::RunnersController do ...@@ -111,7 +111,7 @@ describe Groups::RunnersController do
it 'destroys the runner and redirects' do it 'destroys the runner and redirects' do
delete :destroy, params: params delete :destroy, params: params
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
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
...@@ -124,7 +124,7 @@ describe Groups::RunnersController do ...@@ -124,7 +124,7 @@ describe Groups::RunnersController do
it 'responds 404 and does not destroy the runner' do it 'responds 404 and does not destroy the runner' do
delete :destroy, params: params delete :destroy, params: params
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(Ci::Runner.find_by(id: runner.id)).to be_present expect(Ci::Runner.find_by(id: runner.id)).to be_present
end end
end end
...@@ -143,7 +143,7 @@ describe Groups::RunnersController do ...@@ -143,7 +143,7 @@ describe Groups::RunnersController do
post :resume, params: params post :resume, params: params
end.to change { runner.ensure_runner_queue_value } end.to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(runner.reload.active).to eq(true) expect(runner.reload.active).to eq(true)
end end
end end
...@@ -160,7 +160,7 @@ describe Groups::RunnersController do ...@@ -160,7 +160,7 @@ describe Groups::RunnersController do
post :resume, params: params post :resume, params: params
end.not_to change { runner.ensure_runner_queue_value } end.not_to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(runner.reload.active).to eq(false) expect(runner.reload.active).to eq(false)
end end
end end
...@@ -179,7 +179,7 @@ describe Groups::RunnersController do ...@@ -179,7 +179,7 @@ describe Groups::RunnersController do
post :pause, params: params post :pause, params: params
end.to change { runner.ensure_runner_queue_value } end.to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(302) expect(response).to have_gitlab_http_status(:found)
expect(runner.reload.active).to eq(false) expect(runner.reload.active).to eq(false)
end end
end end
...@@ -196,7 +196,7 @@ describe Groups::RunnersController do ...@@ -196,7 +196,7 @@ describe Groups::RunnersController do
post :pause, params: params post :pause, params: params
end.not_to change { runner.ensure_runner_queue_value } end.not_to change { runner.ensure_runner_queue_value }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
expect(runner.reload.active).to eq(true) expect(runner.reload.active).to eq(true)
end end
end end
......
...@@ -21,7 +21,7 @@ describe Groups::Settings::CiCdController do ...@@ -21,7 +21,7 @@ describe Groups::Settings::CiCdController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, params: { group_id: group } get :show, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show) expect(response).to render_template(:show)
end end
end end
...@@ -34,7 +34,7 @@ describe Groups::Settings::CiCdController do ...@@ -34,7 +34,7 @@ describe Groups::Settings::CiCdController do
it 'renders a 404' do it 'renders a 404' do
get :show, params: { group_id: group } get :show, params: { group_id: group }
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
...@@ -47,7 +47,7 @@ describe Groups::Settings::CiCdController do ...@@ -47,7 +47,7 @@ describe Groups::Settings::CiCdController do
it 'renders show with 200 status code' do it 'renders show with 200 status code' do
get :show, params: { group_id: group } get :show, params: { group_id: group }
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
...@@ -79,7 +79,7 @@ describe Groups::Settings::CiCdController do ...@@ -79,7 +79,7 @@ describe Groups::Settings::CiCdController do
it 'renders a 404' do it 'renders a 404' do
subject subject
expect(response).to have_gitlab_http_status(404) expect(response).to have_gitlab_http_status(:not_found)
end end
end end
end end
...@@ -99,7 +99,7 @@ describe Groups::Settings::CiCdController do ...@@ -99,7 +99,7 @@ describe Groups::Settings::CiCdController do
group.add_maintainer(user) group.add_maintainer(user)
end end
it { is_expected.to have_gitlab_http_status(404) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'when user has enough privileges' do context 'when user has enough privileges' do
...@@ -170,7 +170,7 @@ describe Groups::Settings::CiCdController do ...@@ -170,7 +170,7 @@ describe Groups::Settings::CiCdController do
group.add_owner(user) group.add_owner(user)
end end
it { is_expected.to have_gitlab_http_status(404) } it { is_expected.to have_gitlab_http_status(:not_found) }
end end
context 'when user is an admin' do context 'when user is an admin' do
......
...@@ -50,7 +50,7 @@ describe Groups::VariablesController do ...@@ -50,7 +50,7 @@ describe Groups::VariablesController do
it 'is successful' do it 'is successful' do
get :show, params: { group_id: group }, format: :json get :show, params: { group_id: group }, format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
...@@ -66,7 +66,7 @@ describe Groups::VariablesController do ...@@ -66,7 +66,7 @@ describe Groups::VariablesController do
}, },
format: :json format: :json
expect(response).to have_gitlab_http_status(200) expect(response).to have_gitlab_http_status(:ok)
end end
end end
end end
......
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