diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 18:25:58 +0000 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/models/key_spec.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) | |
download | gitlab-ce-a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4.tar.gz |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/models/key_spec.rb')
-rw-r--r-- | spec/models/key_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 0cb20efcb0a..7468c1b9f0a 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -85,9 +85,9 @@ RSpec.describe Key, :mailer do let_it_be(:expiring_soon_notified) { create(:key, expires_at: 4.days.from_now, user: user, before_expiry_notification_delivered_at: Time.current) } let_it_be(:future_expiry) { create(:key, expires_at: 1.month.from_now, user: user) } - describe '.expired_today_and_not_notified' do - it 'returns keys that expire today' do - expect(described_class.expired_today_and_not_notified).to contain_exactly(expired_today_not_notified) + describe '.expired_and_not_notified' do + it 'returns keys that expire today and in the past' do + expect(described_class.expired_and_not_notified).to contain_exactly(expired_today_not_notified, expired_yesterday) end end @@ -139,7 +139,7 @@ RSpec.describe Key, :mailer do end with_them do - let!(:key) { create(factory) } + let!(:key) { create(factory) } # rubocop:disable Rails/SaveBang let!(:original_fingerprint) { key.fingerprint } let!(:original_fingerprint_sha256) { key.fingerprint_sha256 } @@ -224,7 +224,7 @@ RSpec.describe Key, :mailer do expect(AuthorizedKeysWorker).to receive(:perform_async).with(:remove_key, key.shell_id) - key.destroy + key.destroy! end end @@ -244,7 +244,7 @@ RSpec.describe Key, :mailer do expect(AuthorizedKeysWorker).not_to receive(:perform_async) - key.destroy + key.destroy! end end end |