Skip to content
This repository
Browse code

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
Александр authored February 22, 2010 wycats committed April 13, 2010
10  actionpack/test/controller/new_base/content_type_test.rb
@@ -23,7 +23,9 @@ class ImpliedController < ActionController::Base
23 23
       "content_type/implied/i_am_html_erb.html.erb"         => "Hello world!",
24 24
       "content_type/implied/i_am_xml_erb.xml.erb"          => "<xml>Hello world!</xml>",
25 25
       "content_type/implied/i_am_html_builder.html.builder" => "xml.p 'Hello'",
26  
-      "content_type/implied/i_am_xml_builder.xml.builder"  => "xml.awesome 'Hello'"
  26
+      "content_type/implied/i_am_xml_builder.xml.builder"  => "xml.awesome 'Hello'",
  27
+      "content_type/implied/i_am_rjs_in_html.html.erb" => "<%= render 'i_am_rjs_partial' %>",
  28
+      "content_type/implied/_i_am_rjs_partial.js.rjs" => ""
27 29
     )]
28 30
 
29 31
     def i_am_html_erb()     end
@@ -91,6 +93,12 @@ class ImpliedContentTypeTest < Rack::TestCase
91 93
 
92 94
       assert_header "Content-Type", "application/xml; charset=utf-8"
93 95
     end
  96
+
  97
+    test "sets Content-Type as text/html when rendering *.html.erb with a RJS partial" do
  98
+      get "/content_type/implied/i_am_rjs_in_html"
  99
+
  100
+      assert_header "Content-Type", "text/html; charset=utf-8"
  101
+    end
94 102
   end
95 103
 
96 104
   class ExplicitCharsetTest < Rack::TestCase

0 notes on commit dc25138

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