aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-03-27 00:38:31 -0700
committerJosé Valim <jose.valim@gmail.com>2012-03-27 00:38:31 -0700
commite31ec4700b9e1ca4726cff46fd68442fd6364b7b (patch)
tree28e94d43197fa0e4f18368ad5d17f8b0820232c4 /actionpack/test
parent3eb5be67b14e347951eea2dd13cd6f4a8aaaa38c (diff)
parent449a4fc0957748bca3bddf6a15e4d2ae72e2898f (diff)
downloadrails-e31ec4700b9e1ca4726cff46fd68442fd6364b7b.tar.gz
rails-e31ec4700b9e1ca4726cff46fd68442fd6364b7b.tar.bz2
rails-e31ec4700b9e1ca4726cff46fd68442fd6364b7b.zip
Merge pull request #5603 from drogus/fix-rendered-format-for-render-partial
Fix rendered format for render partial
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/render_test.rb13
-rw-r--r--actionpack/test/fixtures/test/_partial_html_erb.html.erb1
2 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb
index 3cc8a9ddf3..a81c9a420a 100644
--- a/actionpack/test/controller/render_test.rb
+++ b/actionpack/test/controller/render_test.rb
@@ -543,6 +543,10 @@ class TestController < ActionController::Base
render :partial => 'partial'
end
+ def partial_html_erb
+ render :partial => 'partial_html_erb'
+ end
+
def render_to_string_with_partial
@partial_only = render_to_string :partial => "partial_only"
@partial_with_locals = render_to_string :partial => "customer", :locals => { :customer => Customer.new("david") }
@@ -1267,6 +1271,15 @@ class RenderTest < ActionController::TestCase
assert_equal "text/html", @response.content_type
end
+ def test_render_html_formatted_partial_even_with_other_mime_time_in_accept
+ @request.accept = "text/javascript, text/html"
+
+ get :partial_html_erb
+
+ assert_equal "partial.html.erb", @response.body.strip
+ assert_equal "text/html", @response.content_type
+ end
+
def test_should_render_html_partial_with_formats
get :partial_formats_html
assert_equal "partial html", @response.body
diff --git a/actionpack/test/fixtures/test/_partial_html_erb.html.erb b/actionpack/test/fixtures/test/_partial_html_erb.html.erb
new file mode 100644
index 0000000000..4b54875782
--- /dev/null
+++ b/actionpack/test/fixtures/test/_partial_html_erb.html.erb
@@ -0,0 +1 @@
+<%= "partial.html.erb" %>