diff options
author | Yves Senn <yves.senn@garaio.com> | 2012-12-07 14:43:49 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-12-10 09:10:47 +0100 |
commit | ec3429a3d6da2250f360d629fa6300e46f3d53fb (patch) | |
tree | acda7dd44e33baf1d1043609f4773b1cb78b8e23 /actionmailer/test | |
parent | a9dc44677ca0caa3660a54b191dca5229dc25f4f (diff) | |
download | rails-ec3429a3d6da2250f360d629fa6300e46f3d53fb.tar.gz rails-ec3429a3d6da2250f360d629fa6300e46f3d53fb.tar.bz2 rails-ec3429a3d6da2250f360d629fa6300e46f3d53fb.zip |
The return value from mailer methods is not relevant.
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 3c21886502..8d87d34e87 100644 --- a/actionmailer/test/base_test.rb +++ b/actionmailer/test/base_test.rb @@ -505,6 +505,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 52342bc59e..8fca6177bd 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 |