From d6e2f5013cdc0aa830d167a84582f48dc636dc81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 30 Jan 2010 13:07:48 +0100 Subject: Drop AR I18n deprecation and simple use errors.messages as fallback. --- .../test/cases/validations/i18n_validation_test.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'activerecord/test/cases/validations') diff --git a/activerecord/test/cases/validations/i18n_validation_test.rb b/activerecord/test/cases/validations/i18n_validation_test.rb index 5dfbb1516f..a0ff35f948 100644 --- a/activerecord/test/cases/validations/i18n_validation_test.rb +++ b/activerecord/test/cases/validations/i18n_validation_test.rb @@ -50,8 +50,8 @@ class I18nValidationTest < ActiveRecord::TestCase # validates_uniqueness_of w/o mocha def test_validates_associated_finds_custom_model_key_translation - I18n.backend.store_translations 'en', :errors => {:models => {:topic => {:attributes => {:title => {:taken => 'custom message'}}}}} - I18n.backend.store_translations 'en', :errors => {:messages => {:taken => 'global message'}} + I18n.backend.store_translations 'en', :activerecord => {:errors => {:models => {:topic => {:attributes => {:title => {:taken => 'custom message'}}}}}} + I18n.backend.store_translations 'en', :activerecord => {:errors => {:messages => {:taken => 'global message'}}} Topic.validates_uniqueness_of :title unique_topic.valid? @@ -59,7 +59,7 @@ class I18nValidationTest < ActiveRecord::TestCase end def test_validates_associated_finds_global_default_translation - I18n.backend.store_translations 'en', :errors => {:messages => {:taken => 'global message'}} + I18n.backend.store_translations 'en', :activerecord => {:errors => {:messages => {:taken => 'global message'}}} Topic.validates_uniqueness_of :title unique_topic.valid? @@ -83,16 +83,16 @@ class I18nValidationTest < ActiveRecord::TestCase # validates_associated w/o mocha def test_validates_associated_finds_custom_model_key_translation - I18n.backend.store_translations 'en', :errors => {:models => {:topic => {:attributes => {:replies => {:invalid => 'custom message'}}}}} - I18n.backend.store_translations 'en', :errors => {:messages => {:invalid => 'global message'}} + I18n.backend.store_translations 'en', :activerecord => {:errors => {:models => {:topic => {:attributes => {:replies => {:invalid => 'custom message'}}}}}} + I18n.backend.store_translations 'en', :activerecord => {:errors => {:messages => {:invalid => 'global message'}}} Topic.validates_associated :replies replied_topic.valid? - assert_equal ['custom message'], replied_topic.errors[:replies] + assert_equal ['custom message'], replied_topic.errors[:replies].uniq end def test_validates_associated_finds_global_default_translation - I18n.backend.store_translations 'en', :errors => {:messages => {:invalid => 'global message'}} + I18n.backend.store_translations 'en', :activerecord => {:errors => {:messages => {:invalid => 'global message'}}} Topic.validates_associated :replies replied_topic.valid? -- cgit v1.2.3