diff options
author | Sergio Arbeo <serabe@gmail.com> | 2012-03-06 16:20:56 +0100 |
---|---|---|
committer | Sergio Arbeo <serabe@gmail.com> | 2012-03-06 16:20:56 +0100 |
commit | e4e1388318cd281bf27114b608487330ae1a58df (patch) | |
tree | 2553f9a30fcd2b47764e11b9b2b044c712a3463a /actionpack/test/template | |
parent | dc8071520761d954d0958316a45aa9223b70a3d1 (diff) | |
download | rails-e4e1388318cd281bf27114b608487330ae1a58df.tar.gz rails-e4e1388318cd281bf27114b608487330ae1a58df.tar.bz2 rails-e4e1388318cd281bf27114b608487330ae1a58df.zip |
Adds :layout option to render :partial when a collection is given.
Diffstat (limited to 'actionpack/test/template')
-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 7347e15373..122b07d348 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -238,6 +238,10 @@ module RenderTestCases def test_render_partial_with_nil_values_in_collection assert_equal "Hello: davidHello: Anonymous", @view.render(:partial => "test/customer", :collection => [ Customer.new("david"), nil ]) end + + def test_render_partial_with_layout_using_collection_and_template + assert_equal "<b>Hello: Amazon</b><b>Hello: Yahoo</b>", @view.render(:partial => "test/customer", :layout => 'test/b_layout_for_partial', :collection => [ Customer.new("Amazon"), Customer.new("Yahoo") ]) + end def test_render_partial_with_empty_array_should_return_nil assert_nil @view.render(:partial => []) |