aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/test_helper_test.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/actionmailer/test/test_helper_test.rb b/actionmailer/test/test_helper_test.rb
index 772751af87..089933e245 100644
--- a/actionmailer/test/test_helper_test.rb
+++ b/actionmailer/test/test_helper_test.rb
@@ -1,4 +1,5 @@
require 'abstract_unit'
+require 'active_support/testing/stream'
class TestHelperMailer < ActionMailer::Base
def test
@@ -10,6 +11,8 @@ class TestHelperMailer < ActionMailer::Base
end
class TestHelperMailerTest < ActionMailer::TestCase
+ include ActiveSupport::Testing::Stream
+
def test_setup_sets_right_action_mailer_options
assert_equal :test, ActionMailer::Base.delivery_method
assert ActionMailer::Base.perform_deliveries
@@ -122,7 +125,9 @@ class TestHelperMailerTest < ActionMailer::TestCase
def test_assert_enqueued_emails
assert_nothing_raised do
assert_enqueued_emails 1 do
- TestHelperMailer.test.deliver_later
+ silence_stream($stdout) do
+ TestHelperMailer.test.deliver_later
+ end
end
end
end
@@ -130,7 +135,9 @@ class TestHelperMailerTest < ActionMailer::TestCase
def test_assert_enqueued_emails_too_few_sent
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_enqueued_emails 2 do
- TestHelperMailer.test.deliver_later
+ silence_stream($stdout) do
+ TestHelperMailer.test.deliver_later
+ end
end
end
@@ -140,8 +147,10 @@ class TestHelperMailerTest < ActionMailer::TestCase
def test_assert_enqueued_emails_too_many_sent
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_enqueued_emails 1 do
- TestHelperMailer.test.deliver_later
- TestHelperMailer.test.deliver_later
+ silence_stream($stdout) do
+ TestHelperMailer.test.deliver_later
+ TestHelperMailer.test.deliver_later
+ end
end
end
@@ -159,7 +168,9 @@ class TestHelperMailerTest < ActionMailer::TestCase
def test_assert_no_enqueued_emails_failure
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_no_enqueued_emails do
- TestHelperMailer.test.deliver_later
+ silence_stream($stdout) do
+ TestHelperMailer.test.deliver_later
+ end
end
end