diff options
author | José Valim <jose.valim@gmail.com> | 2011-09-22 15:03:05 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-09-22 15:03:05 +0200 |
commit | 119e9e2dafb0cdc5b85613b730333679aef534af (patch) | |
tree | d2d26382e4f606a5c13d7c76cd48ed3f57f11b36 /actionpack/test/template | |
parent | cbaad674f13067c52fa8c1a24dc498e570db4eed (diff) | |
download | rails-119e9e2dafb0cdc5b85613b730333679aef534af.tar.gz rails-119e9e2dafb0cdc5b85613b730333679aef534af.tar.bz2 rails-119e9e2dafb0cdc5b85613b730333679aef534af.zip |
Get rid of update_details in favor of passing details to find_template.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/lookup_context_test.rb | 10 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 5 |
2 files changed, 5 insertions, 10 deletions
diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb index 47b70f05ab..bac2530e3d 100644 --- a/actionpack/test/template/lookup_context_test.rb +++ b/actionpack/test/template/lookup_context_test.rb @@ -31,16 +31,6 @@ class LookupContextTest < ActiveSupport::TestCase assert @lookup_context.formats.frozen? end - test "allows me to change some details to execute an specific block of code" do - formats = Mime::SET - @lookup_context.update_details(:locale => :pt) do - assert_equal formats, @lookup_context.formats - assert_equal :pt, @lookup_context.locale - end - assert_equal formats, @lookup_context.formats - assert_equal :en, @lookup_context.locale - end - test "provides getters and setters for formats" do @lookup_context.formats = [:html] assert_equal [:html], @lookup_context.formats diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 525ef0d726..f3dce0b7f2 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -38,6 +38,11 @@ module RenderTestCases assert_equal "<error>No Comment</error>", @view.render(:file => "comments/empty", :formats => [:xml]) end + 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_localization old_locale, @view.locale = @view.locale, :da assert_equal "Hey verden", @view.render(:file => "test/hello_world") |