Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add missing test for #5308

  • Loading branch information...
commit 7130f9159146776067d334b5043b789860b92761 1 parent 1eb6189
@drogus drogus authored
View
13 actionpack/test/controller/render_test.rb
@@ -560,6 +560,12 @@ def render_to_string_and_render_with_different_formats
render :template => "test/with_partial", :formats => [:text]
end
+ def render_template_within_a_template_with_other_format
+ render :template => "test/with_xml_template",
+ :formats => [:html],
+ :layout => "with_html_partial"
+ end
+
def partial_with_counter
render :partial => "counter", :locals => { :counter_counter => 5 }
end
@@ -1289,6 +1295,13 @@ def test_render_to_string_and_render_with_different_formats
assert_equal "text/plain", @response.content_type
end
+ def test_render_template_within_a_template_with_other_format
+ get :render_template_within_a_template_with_other_format
+ expected = "only html partial<p>This is grand!</p>"
+ assert_equal expected, @response.body.strip
+ assert_equal "text/html", @response.content_type
+ end
+
def test_partial_with_counter
get :partial_with_counter
assert_equal "5", @response.body
View
1  actionpack/test/fixtures/layouts/with_html_partial.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "partial_only_html" %><%= yield %>
View
1  actionpack/test/fixtures/test/with_xml_template.html.erb
@@ -0,0 +1 @@
+<%= render :template => "test/greeting", :formats => :xml %>
Please sign in to comment.
Something went wrong with that request. Please try again.