diff options
Diffstat (limited to 'spec/requests/api/applications_spec.rb')
-rw-r--r-- | spec/requests/api/applications_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/requests/api/applications_spec.rb b/spec/requests/api/applications_spec.rb index ca09f5524ca..959e68e6a0d 100644 --- a/spec/requests/api/applications_spec.rb +++ b/spec/requests/api/applications_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe API::Applications, :api do let(:admin_user) { create(:user, admin: true) } let(:user) { create(:user, admin: false) } - let!(:application) { create(:application, name: 'another_application', redirect_uri: 'http://other_application.url', scopes: '') } + let!(:application) { create(:application, name: 'another_application', owner: nil, redirect_uri: 'http://other_application.url', scopes: '') } describe 'POST /applications' do context 'authenticated and authorized user' do @@ -143,6 +143,12 @@ RSpec.describe API::Applications, :api do expect(response).to have_gitlab_http_status(:no_content) end + + it 'cannot delete non-existing application' do + delete api("/applications/#{non_existing_record_id}", admin_user) + + expect(response).to have_gitlab_http_status(:not_found) + end end context 'authorized user without authorization' do |