summaryrefslogtreecommitdiff
path: root/spec/requests/api/applications_spec.rb
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-12-18 09:52:17 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-12-19 10:04:31 +1100
commitb44a2c801a64fb282cea794871fcfcf81e4ec539 (patch)
tree32e699b6efa548048abe11f29f84e85e3d2a034f /spec/requests/api/applications_spec.rb
parent5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff)
downloadgitlab-ce-b44a2c801a64fb282cea794871fcfcf81e4ec539.tar.gz
Update specs to rails5 formatblackst0ne-convert-specs-rails5-style
Updates specs to use new rails5 format. The old format: `get :show, { some: params }, { some: headers }` The new format: `get :show, params: { some: params }, headers: { some: headers }`
Diffstat (limited to 'spec/requests/api/applications_spec.rb')
-rw-r--r--spec/requests/api/applications_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/requests/api/applications_spec.rb b/spec/requests/api/applications_spec.rb
index 6154be5c425..e47166544d9 100644
--- a/spec/requests/api/applications_spec.rb
+++ b/spec/requests/api/applications_spec.rb
@@ -11,7 +11,7 @@ describe API::Applications, :api do
context 'authenticated and authorized user' do
it 'creates and returns an OAuth application' do
expect do
- post api('/applications', admin_user), name: 'application_name', redirect_uri: 'http://application.url', scopes: ''
+ post api('/applications', admin_user), params: { name: 'application_name', redirect_uri: 'http://application.url', scopes: '' }
end.to change { Doorkeeper::Application.count }.by 1
application = Doorkeeper::Application.find_by(name: 'application_name', redirect_uri: 'http://application.url')
@@ -25,7 +25,7 @@ describe API::Applications, :api do
it 'does not allow creating an application with the wrong redirect_uri format' do
expect do
- post api('/applications', admin_user), name: 'application_name', redirect_uri: 'http://', scopes: ''
+ post api('/applications', admin_user), params: { name: 'application_name', redirect_uri: 'http://', scopes: '' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(400)
@@ -35,7 +35,7 @@ describe API::Applications, :api do
it 'does not allow creating an application with a forbidden URI format' do
expect do
- post api('/applications', admin_user), name: 'application_name', redirect_uri: 'javascript://alert()', scopes: ''
+ post api('/applications', admin_user), params: { name: 'application_name', redirect_uri: 'javascript://alert()', scopes: '' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(400)
@@ -45,7 +45,7 @@ describe API::Applications, :api do
it 'does not allow creating an application without a name' do
expect do
- post api('/applications', admin_user), redirect_uri: 'http://application.url', scopes: ''
+ post api('/applications', admin_user), params: { redirect_uri: 'http://application.url', scopes: '' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(400)
@@ -55,7 +55,7 @@ describe API::Applications, :api do
it 'does not allow creating an application without a redirect_uri' do
expect do
- post api('/applications', admin_user), name: 'application_name', scopes: ''
+ post api('/applications', admin_user), params: { name: 'application_name', scopes: '' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(400)
@@ -65,7 +65,7 @@ describe API::Applications, :api do
it 'does not allow creating an application without scopes' do
expect do
- post api('/applications', admin_user), name: 'application_name', redirect_uri: 'http://application.url'
+ post api('/applications', admin_user), params: { name: 'application_name', redirect_uri: 'http://application.url' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(400)
@@ -77,7 +77,7 @@ describe API::Applications, :api do
context 'authorized user without authorization' do
it 'does not create application' do
expect do
- post api('/applications', user), name: 'application_name', redirect_uri: 'http://application.url', scopes: ''
+ post api('/applications', user), params: { name: 'application_name', redirect_uri: 'http://application.url', scopes: '' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(403)
@@ -87,7 +87,7 @@ describe API::Applications, :api do
context 'non-authenticated user' do
it 'does not create application' do
expect do
- post api('/applications'), name: 'application_name', redirect_uri: 'http://application.url'
+ post api('/applications'), params: { name: 'application_name', redirect_uri: 'http://application.url' }
end.not_to change { Doorkeeper::Application.count }
expect(response).to have_gitlab_http_status(401)