1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added test get to js should have a header with content-type text/javascript

This commit is contained in:
Santiago Pastorino 2010-04-15 21:41:08 -03:00
parent 8a8da68d1f
commit 5699de1d15

View file

@ -23,7 +23,8 @@ module ContentType
"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_js_rjs.js.rjs" => "page.alert 'hello'"
)]
end
@ -86,6 +87,12 @@ module ContentType
assert_header "Content-Type", "application/xml; charset=utf-8"
end
test "sets Content-Type as text/javascript when rendering *.js" do
get "/content_type/implied/i_am_js_rjs", "format" => "js"
assert_header "Content-Type", "text/javascript; charset=utf-8"
end
end
class ExplicitCharsetTest < Rack::TestCase