aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/validations')
-rw-r--r--activerecord/test/cases/validations/i18n_validation_test.rb14
1 files changed, 7 insertions, 7 deletions
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?