diff options
author | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-12-06 12:40:24 -0500 |
---|---|---|
committer | Eileen M. Uchitelle <eileencodes@gmail.com> | 2015-12-06 12:40:24 -0500 |
commit | 0127a0300dd1a6c382342e16b57afd3f3a7bbc8d (patch) | |
tree | 41ad691daf460193cc1c9106540413ba9d3b10d8 | |
parent | 5da05c3e6be52331899742db0dbd6d38e4fdeb1e (diff) | |
parent | 7a8031b578582e07dc11fa1f5c8977f049a313da (diff) | |
download | rails-0127a0300dd1a6c382342e16b57afd3f3a7bbc8d.tar.gz rails-0127a0300dd1a6c382342e16b57afd3f3a7bbc8d.tar.bz2 rails-0127a0300dd1a6c382342e16b57afd3f3a7bbc8d.zip |
Merge pull request #22480 from keepcosmos/add-translate-test
add test for namespaced model name translation
-rw-r--r-- | activemodel/test/cases/translation_test.rb | 5 |
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 |