mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
making sure changes to dup will not touch original
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user