Permalink
Browse files

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

…cale options.
  • Loading branch information...
1 parent 4bfbdc1 commit f8e6664d8647acf11c8f98e00ec5a23326be5d19 @apotonick apotonick committed with josevalim Sep 22, 2011
@@ -0,0 +1 @@
+<h1>Kein Kommentar</h1>
@@ -0,0 +1 @@
+xml.h1 'No Comment'
@@ -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

0 comments on commit f8e6664

Please sign in to comment.