diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-02 09:09:02 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-02 15:16:58 -0200 |
commit | eaa0d0b7744327151d44d0a147fbb70c72678d35 (patch) | |
tree | e4a693e2f9f0c8199c82b8359578a29be9177fe7 /actionpack/test/template/render_test.rb | |
parent | a50ab21cd164cd42eadd877d739d3eec5a24f410 (diff) | |
download | rails-eaa0d0b7744327151d44d0a147fbb70c72678d35.tar.gz rails-eaa0d0b7744327151d44d0a147fbb70c72678d35.tar.bz2 rails-eaa0d0b7744327151d44d0a147fbb70c72678d35.zip |
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
Diffstat (limited to 'actionpack/test/template/render_test.rb')
-rw-r--r-- | actionpack/test/template/render_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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>title</title>\n\n<div id="column">column</div>\n<div id="content">content</div>\n), @view.render(:file => "test/nested_layout", :layout => "layouts/yield") |