aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDmitry Vorotilin <d.vorotilin@gmail.com>2012-07-11 12:18:52 +0400
committerSteve Klabnik <steve@steveklabnik.com>2013-04-02 10:36:23 -0700
commit2c22376fe04b89e8f34620139720b85a85ce3428 (patch)
treebda9c828cf2f7519a48e655b00b813543592d1ed /actionpack/test/template
parent060fca78970e54b6400296325a212632de727b21 (diff)
downloadrails-2c22376fe04b89e8f34620139720b85a85ce3428.tar.gz
rails-2c22376fe04b89e8f34620139720b85a85ce3428.tar.bz2
rails-2c22376fe04b89e8f34620139720b85a85ce3428.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.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index b907e3297b..f20b1c358e 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