diff options
Diffstat (limited to 'spec/models/oauth_access_token_spec.rb')
-rw-r--r-- | spec/models/oauth_access_token_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/models/oauth_access_token_spec.rb b/spec/models/oauth_access_token_spec.rb index 544f6643712..a4540ac95bc 100644 --- a/spec/models/oauth_access_token_spec.rb +++ b/spec/models/oauth_access_token_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' RSpec.describe OauthAccessToken do - let(:user) { create(:user) } let(:app_one) { create(:oauth_application) } let(:app_two) { create(:oauth_application) } let(:app_three) { create(:oauth_application) } @@ -69,4 +68,20 @@ RSpec.describe OauthAccessToken do end end end + + describe '.matching_token_for' do + it 'does not find existing tokens' do + expect(described_class.matching_token_for(app_one, token.resource_owner, token.scopes)).to be_nil + end + + context 'when hash oauth tokens is disabled' do + before do + stub_feature_flags(hash_oauth_tokens: false) + end + + it 'finds an existing token' do + expect(described_class.matching_token_for(app_one, token.resource_owner, token.scopes)).to be_present + end + end + end end |