diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-21 23:55:56 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-22 11:13:02 -0200 |
commit | 19433ce8701d9ff2b311d0a2ec98be366ce461ea (patch) | |
tree | a2acdc41ab925c64d98b7944b3ff2d3928bb2412 /actionpack/test/template/render_test.rb | |
parent | 35626feb61e260ec704ed407768da4c6a2f27a47 (diff) | |
download | rails-19433ce8701d9ff2b311d0a2ec98be366ce461ea.tar.gz rails-19433ce8701d9ff2b311d0a2ec98be366ce461ea.tar.bz2 rails-19433ce8701d9ff2b311d0a2ec98be366ce461ea.zip |
format lookup for partials is derived from the format in which the template is being rendered
Closes #5025 part 2
Diffstat (limited to 'actionpack/test/template/render_test.rb')
-rw-r--r-- | actionpack/test/template/render_test.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index fe013f2475..503bbb207e 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -51,12 +51,16 @@ module RenderTestCases assert_match "<error>No Comment</error>", @view.render(:template => "comments/empty", :formats => [:xml]) end + def test_render_partial_implicitly_use_format_of_the_rendered_template + @view.lookup_context.formats = [:json] + assert_equal "Hello world", @view.render(:template => "test/one", :formats => [:html]) + end + def test_render_template_with_a_missing_partial_of_another_format - @view.lookup_context.freeze_formats([:html]) + @view.lookup_context.formats = [:html] assert_raise ActionView::Template::Error, "Missing partial /missing with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder]}" do @view.render(:template => "with_format", :formats => [:json]) end - assert_equal [:html], @view.lookup_context.formats end def test_render_file_with_locale |