aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/duplication_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-23 10:59:23 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-23 14:29:04 -0800
commit035d00b665a645a12ecd1f9c70dba06bbd4f6201 (patch)
tree86159decf22eb9a40c322d49f0d46fb8b4dc6e48 /activerecord/test/cases/duplication_test.rb
parent5badf60d128cb958fa7a0e3f140517b71b88c7ac (diff)
downloadrails-035d00b665a645a12ecd1f9c70dba06bbd4f6201.tar.gz
rails-035d00b665a645a12ecd1f9c70dba06bbd4f6201.tar.bz2
rails-035d00b665a645a12ecd1f9c70dba06bbd4f6201.zip
making sure changes to dup will not touch original
Diffstat (limited to 'activerecord/test/cases/duplication_test.rb')
-rw-r--r--activerecord/test/cases/duplication_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/duplication_test.rb b/activerecord/test/cases/duplication_test.rb
index f9d614230b..c6f7e3ef16 100644
--- a/activerecord/test/cases/duplication_test.rb
+++ b/activerecord/test/cases/duplication_test.rb
@@ -54,5 +54,15 @@ module ActiveRecord
duped = topic.dup
assert_equal topic.changes, duped.changes
end
+
+ def test_dup_topics_are_independent
+ topic = Topic.first
+ topic.author_name = 'Aaron'
+ duped = topic.dup
+
+ duped.author_name = 'meow'
+
+ assert_not_equal topic.changes, duped.changes
+ end
end
end