aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/base_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-09-05 18:48:10 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-09-05 18:48:10 +0000
commit9d7e6432b22a11e96ad7a3cab7510fac7b3927d6 (patch)
treee2d4d84550401d00a6e0dbe0b38fc6ae475803f5 /activerecord/test/base_test.rb
parentd48322ecca83765a47c054aa72a7165efe9a81f5 (diff)
downloadrails-9d7e6432b22a11e96ad7a3cab7510fac7b3927d6.tar.gz
rails-9d7e6432b22a11e96ad7a3cab7510fac7b3927d6.tar.bz2
rails-9d7e6432b22a11e96ad7a3cab7510fac7b3927d6.zip
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
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-xactiverecord/test/base_test.rb14
1 files changed, 4 insertions, 10 deletions
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?(%(<replies><reply>))
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?(%(<topic-id type="integer">#{topics(:first).topic_id}</topic-id>))
- assert xml.include?(%(<topic-id type="integer">#{topics(:second).topic_id}</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)