From eaa0d0b7744327151d44d0a147fbb70c72678d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Sun, 2 Dec 2012 09:09:02 -0800 Subject: Merge pull request #8402 from senny/8376_descriptive_error_message_for_partial_layout_true More descriptive error when rendering a partial with `:layout => true` Conflicts: actionpack/CHANGELOG.md actionpack/lib/action_view/renderer/partial_renderer.rb --- actionpack/test/template/render_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actionpack/test/template/render_test.rb') diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index bfeb6aee1a..b907e3297b 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -336,7 +336,7 @@ module RenderTestCases 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_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization ActionView::Template::Handlers.extensions ActionView::Template.register_template_handler :foo, CustomHandler @@ -406,6 +406,11 @@ module RenderTestCases @view.render(:partial => 'test/partial_with_layout_block_content', :layout => 'test/layout_for_partial', :locals => { :name => 'Foo!'}) end + def test_render_partial_with_layout_raises_descriptive_error + e = assert_raises(ActionView::MissingTemplate) { @view.render(:partial => 'test/partial', :layout => true) } + assert_match "Missing partial /true with", e.message + end + def test_render_with_nested_layout assert_equal %(title\n\n
column
\n
content
\n), @view.render(:file => "test/nested_layout", :layout => "layouts/yield") -- cgit v1.2.3