diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/models/oauth_access_token_spec.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/models/oauth_access_token_spec.rb')
-rw-r--r-- | spec/models/oauth_access_token_spec.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/spec/models/oauth_access_token_spec.rb b/spec/models/oauth_access_token_spec.rb index a4540ac95bc..92e1ae8ac60 100644 --- a/spec/models/oauth_access_token_spec.rb +++ b/spec/models/oauth_access_token_spec.rb @@ -46,42 +46,11 @@ RSpec.describe OauthAccessToken do expect(described_class.by_token(plaintext_token)).to be_a(OauthAccessToken) end end - - context 'when hash_oauth_secrets is disabled' do - let(:hashed_token) { create(:oauth_access_token, application_id: app_one.id) } - - before do - hashed_token - stub_feature_flags(hash_oauth_tokens: false) - end - - it 'stores the token in plaintext' do - expect(token.token).to eq(token.plaintext_token) - end - - it 'finds a token by plaintext token' do - expect(described_class.by_token(token.plaintext_token)).to be_a(OauthAccessToken) - end - - it 'does not find a token that was previously stored as hashed' do - expect(described_class.by_token(hashed_token.plaintext_token)).to be_nil - 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 |