diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-09-11 16:30:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 16:30:22 -0400 |
commit | 7acd2674fb6822cc3841ae2d59b93695ef18b71a (patch) | |
tree | a1038855dee638770fa4d9640acda3268034b474 /actionmailer/test/log_subscriber_test.rb | |
parent | d54d0c95750e2693da495b75ac5fa0280253972d (diff) | |
parent | 576209b45bf6d20e91562da77e454bc58bda3658 (diff) | |
download | rails-7acd2674fb6822cc3841ae2d59b93695ef18b71a.tar.gz rails-7acd2674fb6822cc3841ae2d59b93695ef18b71a.tar.bz2 rails-7acd2674fb6822cc3841ae2d59b93695ef18b71a.zip |
Merge pull request #33824 from yskkin/suppress_logging
Skip delivery notification when perform_deliveries is false.
Diffstat (limited to 'actionmailer/test/log_subscriber_test.rb')
-rw-r--r-- | actionmailer/test/log_subscriber_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionmailer/test/log_subscriber_test.rb b/actionmailer/test/log_subscriber_test.rb index 2e89758dfb..7686fd10c9 100644 --- a/actionmailer/test/log_subscriber_test.rb +++ b/actionmailer/test/log_subscriber_test.rb @@ -37,6 +37,20 @@ class AMLogSubscriberTest < ActionMailer::TestCase BaseMailer.deliveries.clear end + def test_deliver_message_when_perform_deliveries_is_false + BaseMailer.welcome_without_deliveries.deliver_now + wait + + assert_equal(1, @logger.logged(:info).size) + assert_match("Skipped sending mail to system@test.lindsaar.net as `perform_deliveries` is false", @logger.logged(:info).first) + + assert_equal(2, @logger.logged(:debug).size) + assert_match(/BaseMailer#welcome_without_deliveries: processed outbound mail in [\d.]+ms/, @logger.logged(:debug).first) + assert_match("Welcome", @logger.logged(:debug).second) + ensure + BaseMailer.deliveries.clear + end + def test_receive_is_notified fixture = File.read(File.expand_path("fixtures/raw_email", __dir__)) TestMailer.receive(fixture) |