Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7921

Show
Ignore:
Timestamp:
10/15/07 20:30:48 (1 year ago)
Author:
bitsweat
Message:

Fix silent failure of rxml templates. Closes #9879.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionmailer/CHANGELOG

    r7683 r7921  
     1*SVN* 
     2 
     3* Fix silent failure of rxml templates.  #9879 [jstewart] 
     4 
     5 
    16*2.0.0 [Preview Release]* (September 29th, 2007) 
    27 
  • trunk/actionmailer/test/mail_render_test.rb

    r4523 r7921  
    1414    from       "tester@example.com" 
    1515    body       render(:file => "signed_up", :body => { :recipient => recipient }) 
     16  end 
     17 
     18  def rxml_template(recipient) 
     19    recipients recipient 
     20    subject    "rendering rxml template" 
     21    from       "tester@example.com" 
    1622  end 
    1723 
     
    5662    assert_equal "Hello there, \n\nMr. test@localhost", mail.body.strip 
    5763  end 
     64 
     65  def test_rxml_template 
     66    mail = RenderMailer.deliver_rxml_template(@recipient) 
     67    assert_equal "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test/>", mail.body.strip 
     68  end 
    5869end 
    5970 
  • trunk/actionpack/lib/action_view/base.rb

    r7773 r7921  
    573573          body = case extension.to_sym 
    574574            when :rxml, :builder 
    575               "controller.response.content_type ||= Mime::XML\n" + 
     575              content_type_handler = (controller.respond_to?(:response) ? "controller.response" : "controller") 
     576              "#{content_type_handler}.content_type ||= Mime::XML\n" + 
    576577              "xml = Builder::XmlMarkup.new(:indent => 2)\n" + 
    577578              template +