From f02a35b86efea24f1e2ab684bc8081ced5eb3b1a Mon Sep 17 00:00:00 2001 From: Nikolay Shebanov Date: Tue, 9 Dec 2014 01:13:40 +0100 Subject: Make possible to use blocks with short version of render partial --- actionview/test/template/render_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionview/test/template') diff --git a/actionview/test/template/render_test.rb b/actionview/test/template/render_test.rb index 4e502bede9..11f9b38a3a 100644 --- a/actionview/test/template/render_test.rb +++ b/actionview/test/template/render_test.rb @@ -466,6 +466,11 @@ module RenderTestCases @view.render(:partial => 'test/partial_with_partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end + def test_render_partial_shortcut_with_block_content + assert_equal %(Before (shortcut test)\nBefore\n\n Yielded: arg1/arg2\n\nAfter\nAfter), + @view.render(partial: "test/partial_shortcut_with_block_content", layout: "test/layout_for_partial", locals: { name: "shortcut test" }) + 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!'}) -- cgit v1.2.3