Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-01 00:09:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-01 00:09:15 +0300
commit9c918ae5c688cf492589be0c082956fd72aacea7 (patch)
tree21b7e3ef09c140c22491f2e583887fc2924c7f16 /spec/services/notification_service_spec.rb
parent676109e1b32682bdbdd94a9ffbd8743784f35521 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/notification_service_spec.rb')
-rw-r--r--spec/services/notification_service_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index ad833bb7c71..63bfc090a0d 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -288,6 +288,27 @@ RSpec.describe NotificationService, :mailer do
end
end
end
+
+ describe '#ssh_key_expired' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:fingerprints) { ["aa:bb:cc:dd:ee:zz"] }
+
+ subject { notification.ssh_key_expired(user, fingerprints) }
+
+ it 'sends email to the token owner' do
+ expect { subject }.to have_enqueued_email(user, fingerprints, mail: "ssh_key_expired_email")
+ end
+
+ context 'when user is not allowed to receive notifications' do
+ before do
+ user.block!
+ end
+
+ it 'does not send email to the token owner' do
+ expect { subject }.not_to have_enqueued_email(user, fingerprints, mail: "ssh_key_expired_email")
+ end
+ end
+ end
end
describe '#unknown_sign_in' do