1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add a test for 'render :layout'

To make sure it will show block contents if it is placed after 'render
:partial'

[#5557 state:resolved]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Anton Astashov 2011-02-03 19:09:21 +07:00 committed by Santiago Pastorino
parent e89ba63b88
commit c1c6f29214
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,4 @@
Before
<%= render :partial => "test/partial.html.erb" %>
<%= yield %>
After

View file

@ -209,6 +209,11 @@ module RenderTestCases
@view.formats = nil
end
def test_render_layout_with_block_and_other_partial_inside
render = @view.render(:layout => "test/layout_with_partial_and_yield.html.erb") { "Yield!" }
assert_equal "Before\npartial html\nYield!\nAfter\n", render
end
def test_render_inline
assert_equal "Hello, World!", @view.render(:inline => "Hello, World!")
end