From 015ca366341ba2fa9f1d7903907ddab19a87865f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 6 Oct 2018 13:08:52 +0000 Subject: Send individual emails for each mail recipient (#26791). We are creating multipe mails per class notification event, one per recipient, wrapped in a Mailer::MultiMessage object to send them all at once. We keep the existing interface of all class methods intended to be used by external code the same as they were before, with one exception: We provide additional recipient addresses in options[:recipients] for Mailer.security_notification. Since the first-class recipients have to be users to render individual mails for them, additional recipient addresses have to be provided with some other channel. By providing additional recipients in options[:recipients], we can solve the use-case for address change notifications for users, which probably is the only real use-case for having to use a plain email address instead of a User as a notification recipient. Patch by Holger Just and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17583 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/wiki_content_test.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'test/unit/wiki_content_test.rb') diff --git a/test/unit/wiki_content_test.rb b/test/unit/wiki_content_test.rb index d3cb74427..1b6dcf095 100644 --- a/test/unit/wiki_content_test.rb +++ b/test/unit/wiki_content_test.rb @@ -53,8 +53,10 @@ class WikiContentTest < ActiveSupport::TestCase assert page.save end - assert_equal 1, ActionMailer::Base.deliveries.size - assert_include 'wiki page has been added', mail_body(ActionMailer::Base.deliveries.last) + assert_equal 2, ActionMailer::Base.deliveries.size + ActionMailer::Base.deliveries.each do |mail| + assert_include 'wiki page has been added', mail_body(mail) + end end def test_update_should_be_versioned @@ -100,8 +102,10 @@ class WikiContentTest < ActiveSupport::TestCase assert content.save end - assert_equal 1, ActionMailer::Base.deliveries.size - assert_include 'wiki page has been updated', mail_body(ActionMailer::Base.deliveries.last) + assert_equal 2, ActionMailer::Base.deliveries.size + ActionMailer::Base.deliveries.each do |mail| + assert_include 'wiki page has been updated', mail_body(mail) + end end def test_fetch_history -- cgit v1.2.3