diff options
author | Nick Sutterer <apotonick@gmail.com> | 2011-09-22 16:02:14 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-23 00:36:10 +0200 |
commit | f8e6664d8647acf11c8f98e00ec5a23326be5d19 (patch) | |
tree | 2ea65116ba7dce115f7731e91830f30d5d308d08 /actionpack | |
parent | 4bfbdc133a37c6046b8854d3659ba75597d1d37e (diff) | |
download | rails-f8e6664d8647acf11c8f98e00ec5a23326be5d19.tar.gz rails-f8e6664d8647acf11c8f98e00ec5a23326be5d19.tar.bz2 rails-f8e6664d8647acf11c8f98e00ec5a23326be5d19.zip |
added tests for render :file/:template and the :formats/:handlers/:locale options.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/fixtures/comments/empty.de.html.erb | 1 | ||||
-rw-r--r-- | actionpack/test/fixtures/comments/empty.html.builder | 1 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 18 |
3 files changed, 19 insertions, 1 deletions
diff --git a/actionpack/test/fixtures/comments/empty.de.html.erb b/actionpack/test/fixtures/comments/empty.de.html.erb new file mode 100644 index 0000000000..cffd90dd26 --- /dev/null +++ b/actionpack/test/fixtures/comments/empty.de.html.erb @@ -0,0 +1 @@ +<h1>Kein Kommentar</h1>
\ No newline at end of file diff --git a/actionpack/test/fixtures/comments/empty.html.builder b/actionpack/test/fixtures/comments/empty.html.builder new file mode 100644 index 0000000000..2b0c7207a3 --- /dev/null +++ b/actionpack/test/fixtures/comments/empty.html.builder @@ -0,0 +1 @@ +xml.h1 'No Comment'
\ No newline at end of file diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 120f91b0e7..634e1cdd9f 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -42,8 +42,24 @@ module RenderTestCases 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 |