diff options
Diffstat (limited to 'actionmailer/test/mail_render_test.rb')
| -rw-r--r-- | actionmailer/test/mail_render_test.rb | 26 | 
1 files changed, 23 insertions, 3 deletions
diff --git a/actionmailer/test/mail_render_test.rb b/actionmailer/test/mail_render_test.rb index 45811612eb..514f7ed798 100644 --- a/actionmailer/test/mail_render_test.rb +++ b/actionmailer/test/mail_render_test.rb @@ -5,14 +5,27 @@ class RenderMailer < ActionMailer::Base      recipients recipient      subject    "using helpers"      from       "tester@example.com" -    body       render(:inline => "Hello, <%= @world %>", :body => { :world => "Earth" }) + +    @world = "Earth" +    render :inline => "Hello, <%= @world %>"    end    def file_template(recipient)      recipients recipient      subject    "using helpers"      from       "tester@example.com" -    body       render(:file => "signed_up", :body => { :recipient => recipient }) + +    @recipient = recipient +    render :file => "templates/signed_up" +  end + +  def implicit_body(recipient) +    recipients recipient +    subject    "using helpers" +    from       "tester@example.com" + +    @recipient = recipient +    render :template => "templates/signed_up"    end    def rxml_template(recipient) @@ -31,7 +44,9 @@ class RenderMailer < ActionMailer::Base      recipients recipient      subject    "Including another template in the one being rendered"      from       "tester@example.com" -    body       render(:inline => "Hello, <%= render \"subtemplate\" %>", :body => { :world => "Earth" }) + +    @world = "Earth" +    render :inline => "Hello, <%= render \"subtemplate\" %>"    end    def initialize_defaults(method_name) @@ -69,6 +84,11 @@ class RenderHelperTest < Test::Unit::TestCase      restore_delivery_method    end +  def test_implicit_body +    mail = RenderMailer.create_implicit_body(@recipient) +    assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip +  end +    def test_inline_template      mail = RenderMailer.create_inline_template(@recipient)      assert_equal "Hello, Earth", mail.body.strip  | 
