aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/translation_test.rb
diff options
context:
space:
mode:
authorkeepcosmos <keepcosmos@gmail.com>2015-12-03 14:37:05 +0900
committerkeepcosmos <keepcosmos@gmail.com>2015-12-03 14:37:05 +0900
commit7a8031b578582e07dc11fa1f5c8977f049a313da (patch)
tree114bbbd4a5cbf30933fa4cb3e21b62703116739e /activemodel/test/cases/translation_test.rb
parent215f86c3483cf300b2ccd6d5d8b97f9c9bf547f5 (diff)
downloadrails-7a8031b578582e07dc11fa1f5c8977f049a313da.tar.gz
rails-7a8031b578582e07dc11fa1f5c8977f049a313da.tar.bz2
rails-7a8031b578582e07dc11fa1f5c8977f049a313da.zip
add test for nested model translation
Diffstat (limited to 'activemodel/test/cases/translation_test.rb')
-rw-r--r--activemodel/test/cases/translation_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activemodel/test/cases/translation_test.rb b/activemodel/test/cases/translation_test.rb
index cedc812ec7..2c89388f14 100644
--- a/activemodel/test/cases/translation_test.rb
+++ b/activemodel/test/cases/translation_test.rb
@@ -88,6 +88,11 @@ class ActiveModelI18nTests < ActiveModel::TestCase
assert_equal 'child model', Child.model_name.human
end
+ def test_translated_model_with_namespace
+ I18n.backend.store_translations 'en', activemodel: { models: { 'person/gender': 'gender model' } }
+ assert_equal 'gender model', Person::Gender.model_name.human
+ end
+
def test_translated_model_names_with_ancestors_fallback
I18n.backend.store_translations 'en', activemodel: { models: { person: 'person model' } }
assert_equal 'person model', Child.model_name.human