diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-01 03:20:38 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-01 03:20:38 +0100 |
commit | 8c5fe60ec82986ab4aa337a69c2ab753f518976d (patch) | |
tree | 13ac7474bd3da7b26d7aef896bf98951bffdeeee /activerecord/test/cases/validations/association_validation_test.rb | |
parent | 50fbb7405665ba1c2b7c6f23574053a4764cef7f (diff) | |
download | rails-8c5fe60ec82986ab4aa337a69c2ab753f518976d.tar.gz rails-8c5fe60ec82986ab4aa337a69c2ab753f518976d.tar.bz2 rails-8c5fe60ec82986ab4aa337a69c2ab753f518976d.zip |
Simplify repair_validations on AR and make it work with new callbacks.
Diffstat (limited to 'activerecord/test/cases/validations/association_validation_test.rb')
-rw-r--r-- | activerecord/test/cases/validations/association_validation_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/validations/association_validation_test.rb b/activerecord/test/cases/validations/association_validation_test.rb index 278a7a6a06..5ed997356b 100644 --- a/activerecord/test/cases/validations/association_validation_test.rb +++ b/activerecord/test/cases/validations/association_validation_test.rb @@ -10,7 +10,7 @@ require 'models/interest' class AssociationValidationTest < ActiveRecord::TestCase fixtures :topics, :owners - repair_validations(Topic) + repair_validations(Topic, Reply) def test_validates_size_of_association repair_validations(Owner) do @@ -40,7 +40,8 @@ class AssociationValidationTest < ActiveRecord::TestCase end def test_validates_associated_many - Topic.validates_associated( :replies ) + Topic.validates_associated(:replies) + Reply.validates_presence_of(:content) t = Topic.create("title" => "uhohuhoh", "content" => "whatever") t.replies << [r = Reply.new("title" => "A reply"), r2 = Reply.new("title" => "Another reply", "content" => "non-empty"), r3 = Reply.new("title" => "Yet another reply"), r4 = Reply.new("title" => "The last reply", "content" => "non-empty")] assert !t.valid? |