From 1d07d3d8105efdede4299a491035a980f7778049 Mon Sep 17 00:00:00 2001 From: Yves Senn Date: Tue, 13 Nov 2012 22:02:41 +0100 Subject: render every partial with a new `PartialRenderer`. This resolves issues when rendering nested partials. Previously the `PartialRenderer` was reused which led to situations where the state of the renderer was reset. Closes #8197 --- actionpack/test/controller/render_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/controller/render_test.rb') diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index aa33f01d02..859ed1466b 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -646,6 +646,10 @@ class TestController < ActionController::Base render :partial => "customer", :spacer_template => "partial_only", :collection => [ Customer.new("david"), Customer.new("mary") ] end + def partial_collection_with_spacer_which_uses_render + render :partial => "customer", :spacer_template => "partial_with_partial", :collection => [ Customer.new("david"), Customer.new("mary") ] + end + def partial_collection_shorthand_with_locals render :partial => [ Customer.new("david"), Customer.new("mary") ], :locals => { :greeting => "Bonjour" } end @@ -1445,6 +1449,12 @@ class RenderTest < ActionController::TestCase assert_template :partial => '_customer' end + def test_partial_collection_with_spacer_which_uses_render + get :partial_collection_with_spacer_which_uses_render + assert_equal "Hello: davidpartial html\npartial with partial\nHello: mary", @response.body + assert_template :partial => '_customer' + end + def test_partial_collection_shorthand_with_locals get :partial_collection_shorthand_with_locals assert_equal "Bonjour: davidBonjour: mary", @response.body -- cgit v1.2.3