debian-mirror-gitlab/spec/models/oauth_access_grant_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
511 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe OauthAccessGrant do
2020-01-01 13:55:28 +05:30
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