diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-04-26 20:36:35 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-04-29 14:45:06 -0300 |
commit | d0c9c93c4a3a7da27ab8d9f53811960309f8e18f (patch) | |
tree | a14c5ff56fc74a6d61385141c540f2664439863f /actionpack/test | |
parent | e72374d0ff8b149bdbf8e14a703cbc2028df520c (diff) | |
download | rails-d0c9c93c4a3a7da27ab8d9f53811960309f8e18f.tar.gz rails-d0c9c93c4a3a7da27ab8d9f53811960309f8e18f.tar.bz2 rails-d0c9c93c4a3a7da27ab8d9f53811960309f8e18f.zip |
Allow layout to access current object being rendered when using render partial + object
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/render_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 '<b class="amazon">Hello: Amazon</b><b class="yahoo">Hello: Yahoo</b>', @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 '<b class="amazon">Hello: Amazon</b>', @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 |