aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-10 06:40:33 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-10 06:40:33 -0800
commit287a8d878ce18da401cbcc57c718a43c16e1494e (patch)
tree310308b01cceda3903fde4d9c59112f6540140f0 /actionmailer/test
parentf2d1e279afea3f53277b3ce6edf398f501708c0b (diff)
parentec3429a3d6da2250f360d629fa6300e46f3d53fb (diff)
downloadrails-287a8d878ce18da401cbcc57c718a43c16e1494e.tar.gz
rails-287a8d878ce18da401cbcc57c718a43c16e1494e.tar.bz2
rails-287a8d878ce18da401cbcc57c718a43c16e1494e.zip
Merge pull request #8450 from senny/8448_mailer_return_values
the return value of mailer methods should not be relevant
Diffstat (limited to 'actionmailer/test')
-rw-r--r--actionmailer/test/base_test.rb6
-rw-r--r--actionmailer/test/mailers/base_mailer.rb5
2 files changed, 11 insertions, 0 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 4a608a9ad4..170923673b 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