aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-09 08:54:02 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-09 08:54:02 +0000
commit0faca07056e2dd6284d79522614cb991a680d5d0 (patch)
treec4b49d733b35142b98d40cf9e89866631474e870 /activerecord/test
parent74896c0252bf76c159a40895a5dfe2e75ab112bf (diff)
downloadrails-0faca07056e2dd6284d79522614cb991a680d5d0.tar.gz
rails-0faca07056e2dd6284d79522614cb991a680d5d0.tar.bz2
rails-0faca07056e2dd6284d79522614cb991a680d5d0.zip
Fixed comparison of Active Record objects so two new objects are not equal #2099 [deberg]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2172 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/base_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index b12d0c941d..108955f5a3 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -468,6 +468,10 @@ class BasicsTest < Test::Unit::TestCase
assert_equal Topic.find(1), Topic.find(2).parent
end
+ def test_equality_of_new_records
+ assert_not_equal Topic.new, Topic.new
+ end
+
def test_hashing
assert_equal [ Topic.find(1) ], [ Topic.find(2).parent ] & [ Topic.find(1) ]
end