From d0c9c93c4a3a7da27ab8d9f53811960309f8e18f Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 26 Apr 2012 20:36:35 -0300 Subject: Allow layout to access current object being rendered when using render partial + object --- actionpack/test/template/render_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 5fe725ec31..a76526f946 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -242,6 +242,10 @@ module RenderTestCases assert_equal 'Hello: AmazonHello: Yahoo', @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial_with_object', :collection => [ Customer.new("Amazon"), Customer.new("Yahoo") ]) end + def test_render_partial_with_layout_using_object_and_template_makes_object_available_in_template + assert_equal 'Hello: Amazon', @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial_with_object', :object => Customer.new("Amazon")) + end + def test_render_partial_with_empty_array_should_return_nil assert_nil @view.render(:partial => []) end -- cgit v1.2.3