aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-11-13 13:38:40 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-13 13:38:40 -0200
commite3b68e5f6bbdd782ae37ee0f043f0d738f518dd2 (patch)
treef21b2ce1ec5df2d82a55ae3e078439d82b398f16 /actionpack/test
parent27f4ffd11a91b534fde9b484cb7c4e515ec0fe77 (diff)
downloadrails-e3b68e5f6bbdd782ae37ee0f043f0d738f518dd2.tar.gz
rails-e3b68e5f6bbdd782ae37ee0f043f0d738f518dd2.tar.bz2
rails-e3b68e5f6bbdd782ae37ee0f043f0d738f518dd2.zip
Tests added for rendering partial with layout, when the partial contains another render layout with block call
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/render_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index 08d50257d4..d2bf45a63a 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -277,6 +277,21 @@ module RenderTestCases
@view.render(:partial => 'test/partial_with_partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'})
end
+ def test_render_layout_with_a_nested_render_layout_call
+ assert_equal %(Before (Foo!)\nBefore (Bar!)\npartial html\nAfter\npartial with layout\n\nAfter),
+ @view.render(:partial => 'test/partial_with_layout', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'})
+ end
+
+ def test_render_layout_with_a_nested_render_layout_call_using_block_with_render_partial
+ assert_equal %(Before (Foo!)\nBefore (Bar!)\n\n partial html\n\nAfterpartial with layout\n\nAfter),
+ @view.render(:partial => 'test/partial_with_layout_block_partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'})
+ end
+
+ def test_render_layout_with_a_nested_render_layout_call_using_block_with_render_content
+ assert_equal %(Before (Foo!)\nBefore (Bar!)\n\n Content from inside layout!\n\nAfterpartial with layout\n\nAfter),
+ @view.render(:partial => 'test/partial_with_layout_block_content', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'})
+ end
+
def test_render_with_nested_layout
assert_equal %(<title>title</title>\n\n<div id="column">column</div>\n<div id="content">content</div>\n),
@view.render(:file => "test/nested_layout.erb", :layout => "layouts/yield")