summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-18 20:02:35 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-10-18 20:02:35 +0800
commit045c6715330d25adff95304a3de908037c63a163 (patch)
tree23ed554dd0eed9a2088c1ecf49dd096b77f8a368 /spec/support
parent12ef494db812de3790ad5f42152f9b3fdf8c9f3c (diff)
downloadgitlab-ce-045c6715330d25adff95304a3de908037c63a163.tar.gz
Use bcc for pipeline emails because:
We use bcc here because we don't want to generate this emails for a thousand times. This could be potentially expensive in a loop, and recipients would contain all project watchers so it could be a lot.
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/email_helpers.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/support/email_helpers.rb b/spec/support/email_helpers.rb
index 36f5a2d5975..a946f10f71a 100644
--- a/spec/support/email_helpers.rb
+++ b/spec/support/email_helpers.rb
@@ -7,8 +7,8 @@ module EmailHelpers
ActionMailer::Base.deliveries.clear
end
- def should_only_email(*users)
- recipients = email_recipients
+ def should_only_email(*users, kind: :to)
+ recipients = email_recipients(kind: kind)
users.each { |user| should_email(user, recipients) }
@@ -27,7 +27,7 @@ module EmailHelpers
expect(ActionMailer::Base.deliveries).to be_empty
end
- def email_recipients
- ActionMailer::Base.deliveries.flat_map(&:to)
+ def email_recipients(kind: :to)
+ ActionMailer::Base.deliveries.flat_map(&kind)
end
end