aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorNick Sutterer <apotonick@gmail.com>2011-09-22 11:54:13 +0200
committerJosé Valim <jose.valim@gmail.com>2011-09-22 14:12:36 +0200
commitcbaad674f13067c52fa8c1a24dc498e570db4eed (patch)
tree7c1169ded5c7dbfb4f8342f6ab5735436c2cdf1a /actionpack/test/template
parent41bca5d4667a49666fc5a80bebd91f27099d1674 (diff)
downloadrails-cbaad674f13067c52fa8c1a24dc498e570db4eed.tar.gz
rails-cbaad674f13067c52fa8c1a24dc498e570db4eed.tar.bz2
rails-cbaad674f13067c52fa8c1a24dc498e570db4eed.zip
it is now possible to pass details options (:formats, :details, :locales, ...) to #render, #find_template and friends. this doesn't change anything in global context.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/render_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb
index 8a582030f6..525ef0d726 100644
--- a/actionpack/test/template/render_test.rb
+++ b/actionpack/test/template/render_test.rb
@@ -32,6 +32,12 @@ module RenderTestCases
assert_equal "Hello world!", @view.render(:file => "test/hello_world")
end
+ # Test if :formats, :locale etc. options are passed correctly to the resolvers.
+ def test_render_file_with_format
+ assert_equal "<h1>No Comment</h1>", @view.render(:file => "comments/empty", :formats => [:html])
+ assert_equal "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => [:xml])
+ end
+
def test_render_file_with_localization
old_locale, @view.locale = @view.locale, :da
assert_equal "Hey verden", @view.render(:file => "test/hello_world")