diff options
Diffstat (limited to 'activerecord/test/cases/validations')
-rw-r--r-- | activerecord/test/cases/validations/association_validation_test.rb | 6 | ||||
-rw-r--r-- | activerecord/test/cases/validations/i18n_validation_test.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/cases/validations/association_validation_test.rb b/activerecord/test/cases/validations/association_validation_test.rb index 9d9a5e65e4..b1203c12ed 100644 --- a/activerecord/test/cases/validations/association_validation_test.rb +++ b/activerecord/test/cases/validations/association_validation_test.rb @@ -14,7 +14,7 @@ class AssociationValidationTest < ActiveRecord::TestCase assert_nothing_raised { Owner.validates_size_of :pets, :minimum => 1 } o = Owner.new('name' => 'nopets') assert !o.save - assert o.errors.on(:pets) + assert o.errors[:pets].any? pet = o.pets.build('name' => 'apet') assert o.valid? end @@ -25,14 +25,14 @@ class AssociationValidationTest < ActiveRecord::TestCase assert_nothing_raised { Owner.validates_size_of :pets, :within => 1..2 } o = Owner.new('name' => 'nopets') assert !o.save - assert o.errors.on(:pets) + assert o.errors[:pets].any? pet = o.pets.build('name' => 'apet') assert o.valid? 2.times { o.pets.build('name' => 'apet') } assert !o.save - assert o.errors.on(:pets) + assert o.errors[:pets].any? end end diff --git a/activerecord/test/cases/validations/i18n_validation_test.rb b/activerecord/test/cases/validations/i18n_validation_test.rb index 59730f17b4..c453672815 100644 --- a/activerecord/test/cases/validations/i18n_validation_test.rb +++ b/activerecord/test/cases/validations/i18n_validation_test.rb @@ -76,7 +76,7 @@ class I18nValidationTest < ActiveRecord::TestCase Topic.validates_associated :replies replied_topic.valid? - assert_equal 'custom message', replied_topic.errors.on(:replies) + assert_equal ['custom message'], replied_topic.errors[:replies] end def test_validates_associated_finds_global_default_translation @@ -84,6 +84,6 @@ class I18nValidationTest < ActiveRecord::TestCase Topic.validates_associated :replies replied_topic.valid? - assert_equal 'global message', replied_topic.errors.on(:replies) + assert_equal ['global message'], replied_topic.errors[:replies] end end |