From 9b72c36783516f5ef8f2fac5f6f342a6a48d8d78 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Mon, 10 Dec 2012 17:00:41 +0100 Subject: Backport #8450, the return value from mailer methods is not relevant. Conflicts: actionmailer/CHANGELOG.md actionmailer/lib/action_mailer/base.rb --- actionmailer/test/base_test.rb | 6 ++++++ actionmailer/test/mailers/base_mailer.rb | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'actionmailer/test') 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 -- cgit v1.2.3