From c47aea75766fe3165cc9530fc9ccb5a4ac615e46 Mon Sep 17 00:00:00 2001 From: JB Vasseur Date: Mon, 15 Oct 2018 20:07:56 +0900 Subject: Use have_gitlab_http_status following best practices !22296 --- spec/requests/api/applications_spec.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'spec/requests/api/applications_spec.rb') diff --git a/spec/requests/api/applications_spec.rb b/spec/requests/api/applications_spec.rb index 3e732ed478e..270e12bf201 100644 --- a/spec/requests/api/applications_spec.rb +++ b/spec/requests/api/applications_spec.rb @@ -16,7 +16,7 @@ describe API::Applications, :api do application = Doorkeeper::Application.find_by(name: 'application_name', redirect_uri: 'http://application.url') - expect(response).to have_http_status 201 + expect(response).to have_gitlab_http_status(201) expect(json_response).to be_a Hash expect(json_response['application_id']).to eq application.uid expect(json_response['secret']).to eq application.secret @@ -28,7 +28,7 @@ describe API::Applications, :api do post api('/applications', admin_user), name: 'application_name', redirect_uri: 'wrong_url_format', scopes: '' end.not_to change { Doorkeeper::Application.count } - expect(response).to have_http_status 400 + expect(response).to have_gitlab_http_status(400) expect(json_response).to be_a Hash expect(json_response['message']['redirect_uri'][0]).to eq('must be an absolute URI.') end @@ -38,7 +38,7 @@ describe API::Applications, :api do post api('/applications', admin_user), redirect_uri: 'http://application.url', scopes: '' end.not_to change { Doorkeeper::Application.count } - expect(response).to have_http_status 400 + expect(response).to have_gitlab_http_status(400) expect(json_response).to be_a Hash expect(json_response['error']).to eq('name is missing') end @@ -48,7 +48,7 @@ describe API::Applications, :api do post api('/applications', admin_user), name: 'application_name', scopes: '' end.not_to change { Doorkeeper::Application.count } - expect(response).to have_http_status 400 + expect(response).to have_gitlab_http_status(400) expect(json_response).to be_a Hash expect(json_response['error']).to eq('redirect_uri is missing') end @@ -58,7 +58,7 @@ describe API::Applications, :api do post api('/applications', admin_user), name: 'application_name', redirect_uri: 'http://application.url' end.not_to change { Doorkeeper::Application.count } - expect(response).to have_http_status 400 + expect(response).to have_gitlab_http_status(400) expect(json_response).to be_a Hash expect(json_response['error']).to eq('scopes is missing') end @@ -70,7 +70,7 @@ describe API::Applications, :api do post api('/applications', user), name: 'application_name', redirect_uri: 'http://application.url', scopes: '' end.not_to change { Doorkeeper::Application.count } - expect(response).to have_http_status 403 + expect(response).to have_gitlab_http_status(403) end end @@ -80,7 +80,7 @@ describe API::Applications, :api do post api('/applications'), name: 'application_name', redirect_uri: 'http://application.url' end.not_to change { Doorkeeper::Application.count } - expect(response).to have_http_status 401 + expect(response).to have_gitlab_http_status(401) end end end @@ -99,7 +99,7 @@ describe API::Applications, :api do it 'cannot list application' do get api('/applications', user) - expect(response).to have_http_status 403 + expect(response).to have_gitlab_http_status(403) end end @@ -107,7 +107,7 @@ describe API::Applications, :api do it 'cannot list application' do get api('/applications') - expect(response).to have_http_status 401 + expect(response).to have_gitlab_http_status(401) end end end @@ -127,7 +127,7 @@ describe API::Applications, :api do it 'cannot delete an application' do delete api("/applications/#{application.id}", user) - expect(response).to have_http_status 403 + expect(response).to have_gitlab_http_status(403) end end @@ -135,7 +135,7 @@ describe API::Applications, :api do it 'cannot delete an application' do delete api("/applications/#{application.id}") - expect(response).to have_http_status 401 + expect(response).to have_gitlab_http_status(401) end end end -- cgit v1.2.3