From 9d7e6432b22a11e96ad7a3cab7510fac7b3927d6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 5 Sep 2006 18:48:10 +0000 Subject: Deprecated ActiveRecord::Base.new_record? in favor of ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/base_test.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'activerecord/test/base_test.rb') diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 18c5b50006..33ea40e91a 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -807,7 +807,7 @@ class BasicsTest < Test::Unit::TestCase cloned_topic = nil assert_nothing_raised { cloned_topic = topic.clone } assert_equal topic.title, cloned_topic.title - assert cloned_topic.new_record? + assert cloned_topic.new? # test if the attributes have been cloned topic.title = "a" @@ -822,7 +822,7 @@ class BasicsTest < Test::Unit::TestCase assert_equal "b", topic.title["a"] cloned_topic.save - assert !cloned_topic.new_record? + assert !cloned_topic.new? assert cloned_topic.id != topic.id end @@ -834,7 +834,7 @@ class BasicsTest < Test::Unit::TestCase assert_nothing_raised { clone = dev.clone } assert_kind_of DeveloperSalary, clone.salary assert_equal dev.salary.amount, clone.salary.amount - assert clone.new_record? + assert clone.new? # test if the attributes have been cloned original_amount = clone.salary.amount @@ -842,7 +842,7 @@ class BasicsTest < Test::Unit::TestCase assert_equal original_amount, clone.salary.amount assert clone.save - assert !clone.new_record? + assert !clone.new? assert clone.id != dev.id end @@ -1340,12 +1340,6 @@ class BasicsTest < Test::Unit::TestCase xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :include => :replies) assert xml.include?(%()) end - - def test_array_to_xml_including_methods - xml = [ topics(:first), topics(:second) ].to_xml(:indent => 0, :skip_instruct => true, :methods => [ :topic_id ]) - assert xml.include?(%(#{topics(:first).topic_id})) - assert xml.include?(%(#{topics(:second).topic_id})) - end def test_array_to_xml_including_has_one_association xml = [ companies(:first_firm), companies(:rails_core) ].to_xml(:indent => 0, :skip_instruct => true, :include => :account) -- cgit v1.2.3