summaryrefslogtreecommitdiff
path: root/spec/mailers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-06-11 13:44:45 -0700
committerStan Hu <stanhu@gmail.com>2019-06-12 12:55:25 -0700
commitede045820f6dca8cb5dbf37c88635da21620c81e (patch)
treedf3988dd62214da480a3f720c778f2118a4269d3 /spec/mailers
parentb05de5a583e35931967dcc70d2f26f568c9cf0db (diff)
downloadgitlab-ce-ede045820f6dca8cb5dbf37c88635da21620c81e.tar.gz
Omit blocked admins from repository check e-mailssh-omit-blocked-admins-from-notification
Blocked admins should not receive notifications about failed repository checks. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/63019
Diffstat (limited to 'spec/mailers')
-rw-r--r--spec/mailers/repository_check_mailer_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/mailers/repository_check_mailer_spec.rb b/spec/mailers/repository_check_mailer_spec.rb
index 384660f7221..3dce89f5be2 100644
--- a/spec/mailers/repository_check_mailer_spec.rb
+++ b/spec/mailers/repository_check_mailer_spec.rb
@@ -12,6 +12,16 @@ describe RepositoryCheckMailer do
expect(mail).to deliver_to admins.map(&:email)
end
+ it 'omits blocked admins' do
+ blocked = create(:admin, :blocked)
+ admins = create_list(:admin, 3)
+
+ mail = described_class.notify(1)
+
+ expect(mail.to).not_to include(blocked.email)
+ expect(mail).to deliver_to admins.map(&:email)
+ end
+
it 'mentions the number of failed checks' do
mail = described_class.notify(3)