Skip to content

Commit

Permalink
Add test case which check content type when rendering rjs partial in …
Browse files Browse the repository at this point in the history
…html template

Signed-off-by: wycats <wycats@gmail.com>
  • Loading branch information
Rakoth authored and wycats committed Apr 13, 2010
1 parent dceef08 commit dc25138
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion actionpack/test/controller/new_base/content_type_test.rb
Expand Up @@ -23,7 +23,9 @@ class ImpliedController < ActionController::Base
"content_type/implied/i_am_html_erb.html.erb" => "Hello world!", "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_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_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 def i_am_html_erb() end
Expand Down Expand Up @@ -91,6 +93,12 @@ class ImpliedContentTypeTest < Rack::TestCase


assert_header "Content-Type", "application/xml; charset=utf-8" assert_header "Content-Type", "application/xml; charset=utf-8"
end 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 end


class ExplicitCharsetTest < Rack::TestCase class ExplicitCharsetTest < Rack::TestCase
Expand Down

0 comments on commit dc25138

Please sign in to comment.