diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-05-02 15:54:07 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-05-02 20:59:22 -0300 |
commit | dbacebafac45db1369396a5702f5435b863d3278 (patch) | |
tree | 7b9d17bcfc05c8c3814261bf38695ac75559c966 /activerecord/test/cases/dup_test.rb | |
parent | c1c6f514f482f8880beb8bf6e7471a201ce8af30 (diff) | |
download | rails-dbacebafac45db1369396a5702f5435b863d3278.tar.gz rails-dbacebafac45db1369396a5702f5435b863d3278.tar.bz2 rails-dbacebafac45db1369396a5702f5435b863d3278.zip |
Move dup destroyed test to specific file that tests dup logic
Also change other related test to use existing record rather than
creating new one.
Diffstat (limited to 'activerecord/test/cases/dup_test.rb')
-rw-r--r-- | activerecord/test/cases/dup_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/dup_test.rb b/activerecord/test/cases/dup_test.rb index 1e6ccecfab..b22e8dc153 100644 --- a/activerecord/test/cases/dup_test.rb +++ b/activerecord/test/cases/dup_test.rb @@ -32,6 +32,14 @@ module ActiveRecord assert duped.new_record?, 'topic is new' end + def test_dup_not_destroyed + topic = Topic.first + topic.destroy + + duped = topic.dup + assert_not duped.destroyed? + end + def test_dup_has_no_id topic = Topic.first duped = topic.dup |