From dc251389d1ab4303b80a22642f4241940b73cbe7 Mon Sep 17 00:00:00 2001 From: Stanko Alexander Date: Mon, 22 Feb 2010 16:29:41 +0300 Subject: Add test case which check content type when rendering rjs partial in html template Signed-off-by: wycats --- actionpack/test/controller/new_base/content_type_test.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/new_base/content_type_test.rb b/actionpack/test/controller/new_base/content_type_test.rb index 0ff5552b08..700b71a7f3 100644 --- a/actionpack/test/controller/new_base/content_type_test.rb +++ b/actionpack/test/controller/new_base/content_type_test.rb @@ -23,7 +23,9 @@ module ContentType "content_type/implied/i_am_html_erb.html.erb" => "Hello world!", "content_type/implied/i_am_xml_erb.xml.erb" => "Hello world!", "content_type/implied/i_am_html_builder.html.builder" => "xml.p 'Hello'", - "content_type/implied/i_am_xml_builder.xml.builder" => "xml.awesome 'Hello'" + "content_type/implied/i_am_xml_builder.xml.builder" => "xml.awesome 'Hello'", + "content_type/implied/i_am_rjs_in_html.html.erb" => "<%= render 'i_am_rjs_partial' %>", + "content_type/implied/_i_am_rjs_partial.js.rjs" => "" )] def i_am_html_erb() end @@ -91,6 +93,12 @@ module ContentType assert_header "Content-Type", "application/xml; charset=utf-8" end + + test "sets Content-Type as text/html when rendering *.html.erb with a RJS partial" do + get "/content_type/implied/i_am_rjs_in_html" + + assert_header "Content-Type", "text/html; charset=utf-8" + end end class ExplicitCharsetTest < Rack::TestCase -- cgit v1.2.3