diff options
author | JB Vasseur <jvasseur@gmail.com> | 2018-10-11 15:12:25 +0300 |
---|---|---|
committer | JB Vasseur <jvasseur@gmail.com> | 2018-10-11 15:12:25 +0300 |
commit | 33c88f5e5192bec231656e4253263178d8004e63 (patch) | |
tree | 95f3c75ac0b884e5dbc19a70ef5c7c2bc27f0373 /spec/requests/api/applications_spec.rb | |
parent | 6dd4ae0d87fd9a30ab9ce36b5127be36929f5692 (diff) |
Fix tests
Diffstat (limited to 'spec/requests/api/applications_spec.rb')
-rw-r--r-- | spec/requests/api/applications_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/requests/api/applications_spec.rb b/spec/requests/api/applications_spec.rb index 02dfbfa8fd7..f95b40fff17 100644 --- a/spec/requests/api/applications_spec.rb +++ b/spec/requests/api/applications_spec.rb @@ -88,7 +88,7 @@ describe API::Applications, :api do describe 'GET /applications' do context 'authenticated and authorized user' do it 'can list application' do - get api('/applications') + get api('/applications', admin_user) expect(response).to have_gitlab_http_status(200) expect(json_response).to be_a(Array) @@ -97,7 +97,7 @@ describe API::Applications, :api do context 'non-authenticated user' do it 'cannot list application' do - get api('/applications') + get api('/applications', user) expect(response).to have_http_status 401 end @@ -107,15 +107,17 @@ describe API::Applications, :api do describe 'DELETE /applications/:id' do context 'authenticated and authorized user' do it 'can delete an application' do - delete api("/applications/#{application.id}") - + expect do + delete api("/applications/#{application.id}", admin_user) + end.to change { Doorkeeper::Application.count }.by -1 + expect(response).to have_gitlab_http_status(204) end end context 'non-authenticated user' do it 'cannot delete an application' do - delete api("/applications/#{application.id}") + delete api("/applications/#{application.id}", user) expect(response).to have_http_status 401 end |