diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/models/oauth_access_token_spec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
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 |