diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-20 15:12:38 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-20 15:12:38 +0100 |
commit | 6c57177f2c7f4f934716d588545902d5fc00fa99 (patch) | |
tree | dd5fe4b2e1ab708fdc9aa4324ca382de87da9cf3 /actionpack/test | |
parent | cae1768c6a0e3d1cd4a2c2d836ef213438689db6 (diff) | |
download | rails-6c57177f2c7f4f934716d588545902d5fc00fa99.tar.gz rails-6c57177f2c7f4f934716d588545902d5fc00fa99.tar.bz2 rails-6c57177f2c7f4f934716d588545902d5fc00fa99.zip |
Remove deprecation warnings from Action Pack.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 6 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 32 |
2 files changed, 3 insertions, 35 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index f42a04d670..768cfb34ac 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -43,7 +43,7 @@ class TestController < ActionController::Base end def hello_world_file - render :file => File.expand_path("../../fixtures/hello.html", __FILE__) + render :file => File.expand_path("../../fixtures/hello", __FILE__), :formats => [:html] end def conditional_hello @@ -810,9 +810,7 @@ class RenderTest < ActionController::TestCase end def test_render_file - assert_deprecated do - get :hello_world_file - end + get :hello_world_file assert_equal "Hello world!", @response.body end diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index c29519276d..2ba86306f4 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -146,7 +146,7 @@ module RenderTestCases @view.render(:partial => nil) flunk "Render did not raise ArgumentError" rescue ArgumentError => e - assert_equal "'#{nil.inspect}' is not an ActiveModel-compatible object that returns a valid partial path.", e.message + assert_equal "'#{nil.inspect}' is not an ActiveModel-compatible object. It must implement :to_partial_path.", e.message end def test_render_partial_with_errors @@ -243,36 +243,6 @@ module RenderTestCases @controller_view.render(customers, :greeting => "Hello") end - class CustomerWithDeprecatedPartialPath - attr_reader :name - - def self.model_name - Struct.new(:partial_path).new("customers/customer") - end - - def initialize(name) - @name = name - end - end - - def test_render_partial_using_object_with_deprecated_partial_path - assert_deprecated(/#model_name.*#partial_path.*#to_partial_path/) do - assert_equal "Hello: nertzy", - @controller_view.render(CustomerWithDeprecatedPartialPath.new("nertzy"), :greeting => "Hello") - end - end - - def test_render_partial_using_collection_with_deprecated_partial_path - assert_deprecated(/#model_name.*#partial_path.*#to_partial_path/) do - customers = [ - CustomerWithDeprecatedPartialPath.new("nertzy"), - CustomerWithDeprecatedPartialPath.new("peeja") - ] - assert_equal "Hello: nertzyHello: peeja", - @controller_view.render(customers, :greeting => "Hello") - end - end - # TODO: The reason for this test is unclear, improve documentation def test_render_partial_and_fallback_to_layout assert_equal "Before (Josh)\n\nAfter", @view.render(:partial => "test/layout_for_partial", :locals => { :name => "Josh" }) |