aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-20 17:36:22 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-20 17:36:22 +0000
commit37283a6aaec244cb484e24b3e9ff165e89eadd64 (patch)
treec7fc73588629c15546428ed1462b254f9e7948b2 /activerecord/test/cases/validations
parent4367f39dea7eedb1bf6e7f52b4522c695befe1da (diff)
downloadrails-37283a6aaec244cb484e24b3e9ff165e89eadd64.tar.gz
rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.tar.bz2
rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.zip
Deprecate Error#on(attribute) in favour of Errors#[attribute]
Diffstat (limited to 'activerecord/test/cases/validations')
-rw-r--r--activerecord/test/cases/validations/association_validation_test.rb6
-rw-r--r--activerecord/test/cases/validations/i18n_validation_test.rb4
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