diff options
author | Yves Senn <yves.senn@garaio.com> | 2012-12-10 17:00:41 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-12-10 17:00:41 +0100 |
commit | 9b72c36783516f5ef8f2fac5f6f342a6a48d8d78 (patch) | |
tree | 20730cde9066e43d10f48a51fd37cf58db9eca30 /actionmailer/test | |
parent | d1b9c5fd119a6098a51eb2c2f7b2f52e53b8c240 (diff) | |
download | rails-9b72c36783516f5ef8f2fac5f6f342a6a48d8d78.tar.gz rails-9b72c36783516f5ef8f2fac5f6f342a6a48d8d78.tar.bz2 rails-9b72c36783516f5ef8f2fac5f6f342a6a48d8d78.zip |
Backport #8450, the return value from mailer methods is not relevant.
Conflicts:
actionmailer/CHANGELOG.md
actionmailer/lib/action_mailer/base.rb
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/base_test.rb | 6 | ||||
-rw-r--r-- | actionmailer/test/mailers/base_mailer.rb | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb index b69b26faf0..f648cb1546 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -477,6 +477,12 @@ class BaseTest < ActiveSupport::TestCase mail.deliver end + test 'the return value of mailer methods is not relevant' do + mail = BaseMailer.with_nil_as_return_value + assert_equal('Welcome', mail.body.to_s.strip) + mail.deliver + end + # Before and After hooks class MyObserver diff --git a/actionmailer/test/mailers/base_mailer.rb b/actionmailer/test/mailers/base_mailer.rb index 8c4430b046..50438ead2a 100644 --- a/actionmailer/test/mailers/base_mailer.rb +++ b/actionmailer/test/mailers/base_mailer.rb @@ -118,4 +118,9 @@ class BaseMailer < ActionMailer::Base def without_mail_call end + + def with_nil_as_return_value(hash = {}) + mail(:template_name => "welcome") + nil + end end |