Ticket #11557: action_mailer_render_message_implicit_body_hash.diff
| File action_mailer_render_message_implicit_body_hash.diff, 2.1 kB (added by Henrik N, 3 months ago) |
|---|
-
rails/actionmailer/test/mail_render_test.rb
old new 12 12 recipients recipient 13 13 subject "using helpers" 14 14 from "tester@example.com" 15 body render (:file => "signed_up", :body =>{ :recipient => recipient })15 body render_message("signed_up", { :recipient => recipient }) 16 16 end 17 18 def file_template_with_implicit_body_hash(recipient) 19 recipients recipient 20 subject "using helpers" 21 from "tester@example.com" 22 body[:recipient] = recipient 23 body render_message("signed_up") 24 end 25 26 def file_template_without_body_hash(recipient) 27 recipients recipient 28 subject "using helpers" 29 from "tester@example.com" 30 body render_message("signed_up") 31 end 17 32 18 33 def rxml_template(recipient) 19 34 recipients recipient … … 78 93 mail = RenderMailer.create_file_template(@recipient) 79 94 assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip 80 95 end 96 97 def test_file_template_with_implicit_body_hash 98 mail = RenderMailer.create_file_template_with_implicit_body_hash(@recipient) 99 assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip 100 end 101 102 def test_file_template_without_body_hash 103 mail = RenderMailer.create_file_template_without_body_hash(@recipient) 104 assert_equal "Hello there, \n\nMr.", mail.body.strip 105 end 81 106 82 107 def test_rxml_template 83 108 mail = RenderMailer.deliver_rxml_template(@recipient) -
rails/actionmailer/lib/action_mailer/base.rb
old new 502 502 @mime_version = @@default_mime_version.dup if @@default_mime_version 503 503 end 504 504 505 def render_message(method_name, body )505 def render_message(method_name, body = @body) 506 506 render :file => method_name, :body => body 507 507 end 508 508