aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/test_helper_test.rb
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-05-09 18:59:59 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-05-09 18:59:59 +0900
commit49a59cc6a5e950c56938493da5b23fce77c1cf3f (patch)
treeb85d602b79e058974018e1c9d47c2dfd64c56919 /actionmailer/test/test_helper_test.rb
parent684bbe86cd320549804cb92d4d325e77305b1498 (diff)
downloadrails-49a59cc6a5e950c56938493da5b23fce77c1cf3f.tar.gz
rails-49a59cc6a5e950c56938493da5b23fce77c1cf3f.tar.bz2
rails-49a59cc6a5e950c56938493da5b23fce77c1cf3f.zip
`assert_emails` in block form use the given number as expected value
Diffstat (limited to 'actionmailer/test/test_helper_test.rb')
-rw-r--r--actionmailer/test/test_helper_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionmailer/test/test_helper_test.rb b/actionmailer/test/test_helper_test.rb
index 089933e245..0a4bc75d3e 100644
--- a/actionmailer/test/test_helper_test.rb
+++ b/actionmailer/test/test_helper_test.rb
@@ -112,6 +112,17 @@ class TestHelperMailerTest < ActionMailer::TestCase
assert_match(/1 .* but 2/, error.message)
end
+ def test_assert_emails_message
+ TestHelperMailer.test.deliver_now
+ error = assert_raise ActiveSupport::TestCase::Assertion do
+ assert_emails 2 do
+ TestHelperMailer.test.deliver_now
+ end
+ end
+ assert_match "Expected: 2", error.message
+ assert_match "Actual: 1", error.message
+ end
+
def test_assert_no_emails_failure
error = assert_raise ActiveSupport::TestCase::Assertion do
assert_no_emails do