diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /spec/workers/personal_access_tokens | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'spec/workers/personal_access_tokens')
-rw-r--r-- | spec/workers/personal_access_tokens/expired_notification_worker_spec.rb | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/spec/workers/personal_access_tokens/expired_notification_worker_spec.rb b/spec/workers/personal_access_tokens/expired_notification_worker_spec.rb index 676a419553f..3ff67f47523 100644 --- a/spec/workers/personal_access_tokens/expired_notification_worker_spec.rb +++ b/spec/workers/personal_access_tokens/expired_notification_worker_spec.rb @@ -9,32 +9,16 @@ RSpec.describe PersonalAccessTokens::ExpiredNotificationWorker, type: :worker do context 'when a token has expired' do let(:expired_today) { create(:personal_access_token, expires_at: Date.current) } - context 'when feature is enabled' do - it 'uses notification service to send email to the user' do - expect_next_instance_of(NotificationService) do |notification_service| - expect(notification_service).to receive(:access_token_expired).with(expired_today.user) - end - - worker.perform + it 'uses notification service to send email to the user' do + expect_next_instance_of(NotificationService) do |notification_service| + expect(notification_service).to receive(:access_token_expired).with(expired_today.user) end - it 'updates notified column' do - expect { worker.perform }.to change { expired_today.reload.after_expiry_notification_delivered }.from(false).to(true) - end + worker.perform end - context 'when feature is disabled' do - before do - stub_feature_flags(expired_pat_email_notification: false) - end - - it 'does not update notified column' do - expect { worker.perform }.not_to change { expired_today.reload.after_expiry_notification_delivered } - end - - it 'does not trigger email' do - expect { worker.perform }.not_to change { ActionMailer::Base.deliveries.count } - end + it 'updates notified column' do + expect { worker.perform }.to change { expired_today.reload.after_expiry_notification_delivered }.from(false).to(true) end end |