aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-08 05:01:24 -0700
committerJosé Valim <jose.valim@gmail.com>2011-06-08 05:01:24 -0700
commitb64524d6fdacdd03277efd7b12ff0e8fa97737e2 (patch)
treef8ff6e346eae4560e6d7a0112abcc99c0704455c /activemodel/test
parent8c1762f11e4c2b32a0aff6cbda27f359d8c9d31c (diff)
parent0831b7e076af1ecae41a55dd82cb0582b96518a0 (diff)
downloadrails-b64524d6fdacdd03277efd7b12ff0e8fa97737e2.tar.gz
rails-b64524d6fdacdd03277efd7b12ff0e8fa97737e2.tar.bz2
rails-b64524d6fdacdd03277efd7b12ff0e8fa97737e2.zip
Merge pull request #1556 from thoefer/master
Brought back alternative convention for namespaced models in i18n
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/translation_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb
index 1b1d972d5c..838956bc98 100644
--- a/activemodel/test/cases/translation_test.rb
+++ b/activemodel/test/cases/translation_test.rb
@@ -76,5 +76,15 @@ class ActiveModelI18nTests < ActiveModel::TestCase
Person.model_name.human(options)
assert_equal({:default => 'person model'}, options)
end
+
+ def test_alternate_namespaced_model_attribute_translation
+ I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:gender => {:attribute => 'person gender attribute'}}}}
+ assert_equal 'person gender attribute', Person::Gender.human_attribute_name('attribute')
+ end
+
+ def test_alternate_namespaced_model_translation
+ I18n.backend.store_translations 'en', :activemodel => {:models => {:person => {:gender => 'person gender model'}}}
+ assert_equal 'person gender model', Person::Gender.model_name.human
+ end
end