Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added tests for render :file/:template and the :formats/:handlers/:lo…

…cale options.
  • Loading branch information...
commit f8e6664d8647acf11c8f98e00ec5a23326be5d19 1 parent 4bfbdc1
Nick Sutterer apotonick authored josevalim committed
1  actionpack/test/fixtures/comments/empty.de.html.erb
View
@@ -0,0 +1 @@
+<h1>Kein Kommentar</h1>
1  actionpack/test/fixtures/comments/empty.html.builder
View
@@ -0,0 +1 @@
+xml.h1 'No Comment'
18 actionpack/test/template/render_test.rb
View
@@ -42,8 +42,24 @@ def test_render_template_with_format
assert_equal "<h1>No Comment</h1>", @view.render(:template => "comments/empty", :formats => [:html])
assert_equal "<error>No Comment</error>", @view.render(:template => "comments/empty", :formats => [:xml])
end
+
+ def test_render_file_with_locale
+ assert_equal "<h1>Kein Kommentar</h1>", @view.render(:file => "comments/empty", :locale => [:de])
+ end
+
+ def test_render_template_with_locale
+ assert_equal "<h1>Kein Kommentar</h1>", @view.render(:template => "comments/empty", :locale => [:de])
+ end
+
+ def test_render_file_with_handlers
+ assert_equal "<h1>No Comment</h1>\n", @view.render(:file => "comments/empty", :handlers => [:builder])
+ end
+
+ def test_render_template_with_handlers
+ assert_equal "<h1>No Comment</h1>\n", @view.render(:template => "comments/empty", :handlers => [:builder])
+ end
- def test_render_file_with_localization
+ def test_render_file_with_localization_on_context_level
old_locale, @view.locale = @view.locale, :da
assert_equal "Hey verden", @view.render(:file => "test/hello_world")
ensure
Please sign in to comment.
Something went wrong with that request. Please try again.