From 035d00b665a645a12ecd1f9c70dba06bbd4f6201 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 23 Nov 2010 10:59:23 -0800 Subject: making sure changes to dup will not touch original --- activerecord/test/cases/duplication_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activerecord/test/cases') 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 -- cgit v1.2.3