diff options
Diffstat (limited to 'actionpack/test/controller/new_base')
-rw-r--r-- | actionpack/test/controller/new_base/content_type_test.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/test/controller/new_base/content_type_test.rb b/actionpack/test/controller/new_base/content_type_test.rb index 47206828be..33c2e442f0 100644 --- a/actionpack/test/controller/new_base/content_type_test.rb +++ b/actionpack/test/controller/new_base/content_type_test.rb @@ -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 |