diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-20 16:48:43 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-20 17:53:02 -0200 |
commit | 8b86259beadd18a949669ac83c0e2b647288c06d (patch) | |
tree | 6858a3f552a92c44527bd472d442246329c665c1 /actionpack/test/template/render_test.rb | |
parent | 8c870f11f2acecc56bfb6e77db2330cd9bdd9135 (diff) | |
download | rails-8b86259beadd18a949669ac83c0e2b647288c06d.tar.gz rails-8b86259beadd18a949669ac83c0e2b647288c06d.tar.bz2 rails-8b86259beadd18a949669ac83c0e2b647288c06d.zip |
Use the right format when a partial is missing.
Closes #5025
Diffstat (limited to 'actionpack/test/template/render_test.rb')
-rw-r--r-- | actionpack/test/template/render_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 893c3498e8..4eb3754a50 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -51,6 +51,13 @@ module RenderTestCases assert_match "<error>No Comment</error>", @view.render(:template => "comments/empty", :formats => [:xml]) end + def test_render_template_with_a_missing_partial_of_another_format + assert_raise ActionView::Template::Error, "Missing partial /missing with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder]}" do + @view.lookup_context.freeze_formats([:html]) + @view.render(:template => "with_format", :formats => [:json]) + end + end + def test_render_file_with_locale assert_equal "<h1>Kein Kommentar</h1>", @view.render(:file => "comments/empty", :locale => [:de]) assert_equal "<h1>Kein Kommentar</h1>", @view.render(:file => "comments/empty", :locale => :de) |