diff options
Diffstat (limited to 'actionmailer/test/mail_render_test.rb')
-rw-r--r-- | actionmailer/test/mail_render_test.rb | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/actionmailer/test/mail_render_test.rb b/actionmailer/test/mail_render_test.rb index d581965284..642e15fe60 100644 --- a/actionmailer/test/mail_render_test.rb +++ b/actionmailer/test/mail_render_test.rb @@ -15,7 +15,7 @@ class RenderMailer < ActionMailer::Base recipients recipient subject "using helpers" from "tester@example.com" - body render(:file => "signed_up", :body => { :recipient => recipient }) + body render(:file => "#{mailer_name}/signed_up", :body => { :recipient => recipient }) end def initialize_defaults(method_name) @@ -24,6 +24,22 @@ class RenderMailer < ActionMailer::Base end end +class FirstMailer < ActionMailer::Base + def share(recipient) + recipients recipient + subject "using helpers" + from "tester@example.com" + end +end + +class SecondMailer < ActionMailer::Base + def share(recipient) + recipients recipient + subject "using helpers" + from "tester@example.com" + end +end + RenderMailer.template_root = File.dirname(__FILE__) + "/fixtures" class RenderHelperTest < Test::Unit::TestCase @@ -46,3 +62,23 @@ class RenderHelperTest < Test::Unit::TestCase end end +class FirstSecondHelperTest < Test::Unit::TestCase + def setup + ActionMailer::Base.delivery_method = :test + ActionMailer::Base.perform_deliveries = true + ActionMailer::Base.deliveries = [] + + @recipient = 'test@localhost' + end + + def test_ordering + mail = FirstMailer.create_share(@recipient) + assert_equal "first mail", mail.body.strip + mail = SecondMailer.create_share(@recipient) + assert_equal "second mail", mail.body.strip + mail = FirstMailer.create_share(@recipient) + assert_equal "first mail", mail.body.strip + mail = SecondMailer.create_share(@recipient) + assert_equal "second mail", mail.body.strip + end +end |