summaryrefslogtreecommitdiff
path: root/spec/models/oauth_access_grant_spec.rb
blob: 955dae906f3d06ea0bfbf5832de6bea72ba9845d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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