From 4ad5aa9a39a83863331a7665407dac475855765b Mon Sep 17 00:00:00 2001 From: Ryan Bates Date: Tue, 28 Oct 2008 17:31:33 -0500 Subject: Ensure @content_for_* is checked before yielding to block in render :layout [#8994 state:resolved] Signed-off-by: Joshua Peek --- actionpack/test/template/render_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 7e4fff3da6..da8c782880 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -162,4 +162,14 @@ class ViewRenderTest < Test::Unit::TestCase ActionView::Template.register_template_handler :foo, CustomHandler assert_equal 'source: "Hello, <%= name %>!"', @view.render(:inline => "Hello, <%= name %>!", :locals => { :name => "Josh" }, :type => :foo) end + + def test_render_with_layout + assert_equal %(\nHello world!\n), + @view.render(:file => "test/hello_world.erb", :layout => "layouts/yield") + end + + def test_render_with_nested_layout + assert_equal %(title\n
column
\n
content
\n), + @view.render(:file => "test/nested_layout.erb", :layout => "layouts/yield") + end end -- cgit v1.2.3