diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 15:06:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-03 15:06:20 +0000 |
commit | 4204cf308596e0e26f578a6e2da88f49c0f4aad9 (patch) | |
tree | 644447bcb576a459e079318b06712b7c89416e2b /spec/models/oauth_access_grant_spec.rb | |
parent | cd4cb29b2c304f00d238ee72fe40c767cb3e2675 (diff) | |
download | gitlab-ce-4204cf308596e0e26f578a6e2da88f49c0f4aad9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/oauth_access_grant_spec.rb')
-rw-r--r-- | spec/models/oauth_access_grant_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/oauth_access_grant_spec.rb b/spec/models/oauth_access_grant_spec.rb new file mode 100644 index 00000000000..955dae906f3 --- /dev/null +++ b/spec/models/oauth_access_grant_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe OauthAccessGrant do + let(:user) { create(:user) } + let(:application) { create(:oauth_application, owner: user) } + + describe '#delete' do + it 'cascades to oauth_openid_requests' do + access_grant = create(:oauth_access_grant, application: application) + create(:oauth_openid_request, access_grant: access_grant) + + expect { access_grant.delete }.to change(Doorkeeper::OpenidConnect::Request, :count).by(-1) + end + end +end |