Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test case which check content type when rendering rjs partial in …

…html template

Signed-off-by: wycats <wycats@gmail.com>
  • Loading branch information...
commit dc251389d1ab4303b80a22642f4241940b73cbe7 1 parent dceef08
@Rakoth Rakoth authored wycats committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 actionpack/test/controller/new_base/content_type_test.rb
View
10 actionpack/test/controller/new_base/content_type_test.rb
@@ -23,7 +23,9 @@ class ImpliedController < ActionController::Base
"content_type/implied/i_am_html_erb.html.erb" => "Hello world!",
"content_type/implied/i_am_xml_erb.xml.erb" => "<xml>Hello world!</xml>",
"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 @@ class ImpliedContentTypeTest < Rack::TestCase
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

0 comments on commit dc25138

Please sign in to comment.
Something went wrong with that request. Please try again.