diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-04-04 17:34:23 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2010-04-04 17:34:23 +0100 |
commit | 00884a59013a658082dab41da5ff41add31b8c43 (patch) | |
tree | 666b862b08b04c7a3727ee22b2cd1a2561af4e52 /activemodel/test/cases/validations/i18n_validation_test.rb | |
parent | 48b2451142355b22de5f8130b3debdd4e53e2ba2 (diff) | |
parent | 7d7e0627a0490b6b4ddb0ee5429264ccd46f1245 (diff) | |
download | rails-00884a59013a658082dab41da5ff41add31b8c43.tar.gz rails-00884a59013a658082dab41da5ff41add31b8c43.tar.bz2 rails-00884a59013a658082dab41da5ff41add31b8c43.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activemodel/test/cases/validations/i18n_validation_test.rb')
-rw-r--r-- | activemodel/test/cases/validations/i18n_validation_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activemodel/test/cases/validations/i18n_validation_test.rb b/activemodel/test/cases/validations/i18n_validation_test.rb index 38844bb1fa..7dd82e711d 100644 --- a/activemodel/test/cases/validations/i18n_validation_test.rb +++ b/activemodel/test/cases/validations/i18n_validation_test.rb @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + require "cases/helper" require 'cases/tests_database' require 'models/person' @@ -41,6 +43,14 @@ class I18nValidationTest < ActiveModel::TestCase @person.errors.add_on_blank :title, 'custom' end + def test_full_message_encoding + I18n.backend.store_translations('en', :errors => { + :messages => { :too_short => '猫舌' }}) + Person.validates_length_of :title, :within => 3..5 + @person.valid? + assert_equal ['Title 猫舌'], @person.errors.full_messages + end + def test_errors_full_messages_translates_human_attribute_name_for_model_attributes @person.errors.add(:name, 'not found') Person.expects(:human_attribute_name).with(:name, :default => 'Name').returns("Person's name") |