diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/models/personal_access_token_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/models/personal_access_token_spec.rb')
-rw-r--r-- | spec/models/personal_access_token_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/personal_access_token_spec.rb b/spec/models/personal_access_token_spec.rb index a39a37b605f..9e80d0e0886 100644 --- a/spec/models/personal_access_token_spec.rb +++ b/spec/models/personal_access_token_spec.rb @@ -180,6 +180,18 @@ RSpec.describe PersonalAccessToken do end end + describe '.expired_today_and_not_notified' do + let_it_be(:active) { create(:personal_access_token) } + let_it_be(:expired_yesterday) { create(:personal_access_token, expires_at: Date.yesterday) } + let_it_be(:revoked_token) { create(:personal_access_token, expires_at: Date.current, revoked: true) } + let_it_be(:expired_today) { create(:personal_access_token, expires_at: Date.current) } + let_it_be(:expired_today_and_notified) { create(:personal_access_token, expires_at: Date.current, after_expiry_notification_delivered: true) } + + it 'returns tokens that have expired today' do + expect(described_class.expired_today_and_not_notified).to contain_exactly(expired_today) + end + end + describe '.without_impersonation' do let_it_be(:impersonation_token) { create(:personal_access_token, :impersonation) } let_it_be(:personal_access_token) { create(:personal_access_token) } |