Skip to content
Browse files

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>
  • Loading branch information...
1 parent 8a73ebb commit 53b0235282ebb4953ef2e0644e64c232ec902ef2 Anton Astashov committed with spastorino
View
4 actionpack/test/fixtures/test/_layout_with_partial_and_yield.html.erb
@@ -0,0 +1,4 @@
+Before
+<%= render :partial => "test/partial.html.erb" %>
+<%= yield %>
+After
View
5 actionpack/test/template/render_test.rb
@@ -195,6 +195,11 @@ def test_render_missing_xml_partial_and_raise_missing_template
@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

0 comments on commit 53b0235

Please sign in to comment.
Something went wrong with that request. Please try again.