aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorStanko Alexander <rakoth3d@gmail.com>2010-02-22 16:29:41 +0300
committerwycats <wycats@gmail.com>2010-04-13 13:09:41 -0700
commitdc251389d1ab4303b80a22642f4241940b73cbe7 (patch)
treef175ef6e7def9a9da7b7043f79f2efe2f03d28c2 /actionpack/test/controller
parentdceef0828a23e8298dd9a9aab1a33c49e84f17d6 (diff)
downloadrails-dc251389d1ab4303b80a22642f4241940b73cbe7.tar.gz
rails-dc251389d1ab4303b80a22642f4241940b73cbe7.tar.bz2
rails-dc251389d1ab4303b80a22642f4241940b73cbe7.zip
Add test case which check content type when rendering rjs partial in html template
Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/new_base/content_type_test.rb10
1 files changed, 9 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 0ff5552b08..700b71a7f3 100644
--- a/actionpack/test/controller/new_base/content_type_test.rb
+++ b/actionpack/test/controller/new_base/content_type_test.rb
@@ -23,7 +23,9 @@ 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_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
@@ -91,6 +93,12 @@ module ContentType
assert_header "Content-Type", "application/xml; charset=utf-8"
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
class ExplicitCharsetTest < Rack::TestCase