aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-04-01 21:42:03 -0700
committerwycats <wycats@gmail.com>2010-04-02 09:14:55 -0700
commit30f3a3df77a63f09a291c70f26a8a4f534827cd2 (patch)
tree00f227f22d1a315a9816e6d58f2b0cacee87965a /activemodel/test/cases
parent3adaef8ae73a3061a9fe4c5e0256d80bc09b1cf4 (diff)
downloadrails-30f3a3df77a63f09a291c70f26a8a4f534827cd2.tar.gz
rails-30f3a3df77a63f09a291c70f26a8a4f534827cd2.tar.bz2
rails-30f3a3df77a63f09a291c70f26a8a4f534827cd2.zip
errors.rb needs to be declared as UTF-8 [#3941 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r--activemodel/test/cases/validations/i18n_validation_test.rb10
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")