diff options
author | Dmitry Vorotilin <d.vorotilin@gmail.com> | 2012-07-11 12:18:52 +0400 |
---|---|---|
committer | Dmitry Vorotilin <d.vorotilin@gmail.com> | 2012-07-18 10:48:24 +0400 |
commit | eb19ca3457c7b9908c71376f9b3b4431fcd24c6f (patch) | |
tree | a97dfbd60788f860f92d64748a8b9bd673b23bfd /actionpack/test/template | |
parent | d00b635242120f4262178909d93faf4473b1055e (diff) | |
download | rails-eb19ca3457c7b9908c71376f9b3b4431fcd24c6f.tar.gz rails-eb19ca3457c7b9908c71376f9b3b4431fcd24c6f.tar.bz2 rails-eb19ca3457c7b9908c71376f9b3b4431fcd24c6f.zip |
Common behavior with adding formats to lookup_context for TemplateRenderer and PartialRenderer
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/render_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 88ed8664c2..3ce1d20bd9 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -54,6 +54,16 @@ module RenderTestCases assert_equal "Hello world", @view.render(:template => "test/one", :formats => [:html]) end + def test_render_partial_implicitly_use_format_of_the_rendered_partial + @view.lookup_context.formats = [:html] + assert_equal "Third level", @view.render(:template => "test/html_template") + end + + def test_render_partial_use_last_prepended_format_for_partials_with_the_same_names + @view.lookup_context.formats = [:html] + assert_equal "\nHTML Template, but JSON partial", @view.render(:template => "test/change_priorty") + end + def test_render_template_with_a_missing_partial_of_another_format @view.lookup_context.formats = [:html] assert_raise ActionView::Template::Error, "Missing partial /missing with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder]}" do |