Commit c47aea75 authored by JB Vasseur's avatar JB Vasseur

Use have_gitlab_http_status following best practices !22296

parent abf7c10b
......@@ -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
......
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