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:
parent
e89ba63b88
commit
c1c6f29214
2 changed files with 9 additions and 0 deletions
4
actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb
vendored
Normal file
4
actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
Before
|
||||
<%= render :partial => "test/partial.html.erb" %>
|
||||
<%= yield %>
|
||||
After
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue