Ticket #2926: support_shared_partials_in_actionmailer.diff
| File support_shared_partials_in_actionmailer.diff, 1.9 kB (added by sublogical, 1 year ago) |
|---|
-
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(:file => "test_mailer/signed_up", :body => { :recipient => recipient }) 16 16 end 17 17 18 def message_render(recipient) 19 recipients recipient 20 subject "using helpers" 21 from "tester@example.com" 22 body render_message("signed_up", { :recipient => recipient }) 23 end 24 18 25 def initialize_defaults(method_name) 19 26 super 20 27 mailer_name "test_mailer" … … 55 62 mail = RenderMailer.create_file_template(@recipient) 56 63 assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip 57 64 end 65 66 def test_file_template 67 mail = RenderMailer.create_message_render(@recipient) 68 assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip 69 end 58 70 end 59 71 60 72 class FirstSecondHelperTest < Test::Unit::TestCase -
actionmailer/lib/action_mailer/base.rb
old new 475 475 end 476 476 477 477 def render_message(method_name, body) 478 render :file => method_name, :body => body478 render :file => "#{mailer_name}/#{method_name}", :body => body 479 479 end 480 480 481 481 def render(opts) … … 488 488 end 489 489 490 490 def initialize_template_class(assigns) 491 ActionView::Base.new(template_ path, assigns, self)491 ActionView::Base.new(template_root, assigns, self) 492 492 end 493 493 494 494 def sort_parts(parts, order = [])