Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…script
  • Loading branch information...
commit 5699de1d15e84edca83b4825e7ed84f5636ed88a 1 parent 8a8da68
@spastorino spastorino authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 actionpack/test/controller/new_base/content_type_test.rb
View
9 actionpack/test/controller/new_base/content_type_test.rb
@@ -23,7 +23,8 @@ 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_js_rjs.js.rjs" => "page.alert 'hello'"
)]
end
@@ -86,6 +87,12 @@ class ImpliedContentTypeTest < Rack::TestCase
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
Please sign in to comment.
Something went wrong with that request. Please try again.