diff options
author | Sharang Dashputre <sharang.d@gmail.com> | 2019-03-12 00:39:58 +0530 |
---|---|---|
committer | Sharang Dashputre <sharang.d@gmail.com> | 2019-03-12 01:48:21 +0530 |
commit | 818437c3664039f7038364910fc4ac80450f36a2 (patch) | |
tree | b0886b71a3320e222c1a0ae06e7b9aeefc1266fd /activesupport/test/core_ext | |
parent | 878e98091d93603e07620ca9177f58a880ab9cb8 (diff) | |
download | rails-818437c3664039f7038364910fc4ac80450f36a2.tar.gz rails-818437c3664039f7038364910fc4ac80450f36a2.tar.bz2 rails-818437c3664039f7038364910fc4ac80450f36a2.zip |
Fix bug with parametrize when `locale` is passed
Also add tests for parametrize and transliterate
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r-- | activesupport/test/core_ext/string_ext_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 2468fe3603..4ffa33aa61 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -206,6 +206,12 @@ class StringInflectionsTest < ActiveSupport::TestCase end end + def test_parameterize_with_locale + word = "Fünf autos" + I18n.backend.store_translations(:de, i18n: { transliterate: { rule: { "ü" => "ue" } } }) + assert_equal("fuenf-autos", word.parameterize(locale: :de)) + end + def test_humanize UnderscoreToHuman.each do |underscore, human| assert_equal(human, underscore.humanize) |