From 6c57177f2c7f4f934716d588545902d5fc00fa99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 20 Dec 2011 15:12:38 +0100 Subject: Remove deprecation warnings from Action Pack. --- actionpack/test/template/render_test.rb | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'actionpack/test/template') 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" }) -- cgit v1.2.3