summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorJB Vasseur <jvasseur@gmail.com>2018-10-15 20:07:56 +0900
committerJB Vasseur <jvasseur@gmail.com>2018-10-15 20:07:56 +0900
commitc47aea75766fe3165cc9530fc9ccb5a4ac615e46 (patch)
treeaeb627582f16ab084b0eddf3a8cf4d1b27522ebe /spec/requests
parentabf7c10b67cfd7827370b25f1e4c64a3f615670b (diff)
downloadgitlab-ce-c47aea75766fe3165cc9530fc9ccb5a4ac615e46.tar.gz
Use have_gitlab_http_status following best practices !22296
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/applications_spec.rb22
1 files changed, 11 insertions, 11 deletions
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