diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-01-09 11:07:37 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-01-22 05:24:23 +0900 |
commit | 59e2630ca7570deeb503713986681cf1f2e317ec (patch) | |
tree | bcd80e01515b801b77d8649a864830cdc9a53867 | |
parent | f667f0f7ee63a14e600abb0a32446193794c28f1 (diff) | |
download | rails-59e2630ca7570deeb503713986681cf1f2e317ec.tar.gz rails-59e2630ca7570deeb503713986681cf1f2e317ec.tar.bz2 rails-59e2630ca7570deeb503713986681cf1f2e317ec.zip |
Missing repair_validations
-rw-r--r-- | activerecord/test/cases/dup_test.rb | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/activerecord/test/cases/dup_test.rb b/activerecord/test/cases/dup_test.rb index 4e2adff344..eca500f7e4 100644 --- a/activerecord/test/cases/dup_test.rb +++ b/activerecord/test/cases/dup_test.rb @@ -108,18 +108,20 @@ module ActiveRecord end def test_dup_validity_is_independent - Topic.validates_presence_of :title - topic = Topic.new("title" => "Litterature") - topic.valid? - - duped = topic.dup - duped.title = nil - assert duped.invalid? - - topic.title = nil - duped.title = 'Mathematics' - assert topic.invalid? - assert duped.valid? + repair_validations(Topic) do + Topic.validates_presence_of :title + topic = Topic.new("title" => "Litterature") + topic.valid? + + duped = topic.dup + duped.title = nil + assert duped.invalid? + + topic.title = nil + duped.title = 'Mathematics' + assert topic.invalid? + assert duped.valid? + end end end end |