aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2019-03-11 21:41:30 +0100
committerGitHub <noreply@github.com>2019-03-11 21:41:30 +0100
commitcab396f4238997421181057645ab13e552881208 (patch)
tree6a5f2410a1a09538719eab7e002afa74911d2c4c /activesupport/test/core_ext
parent3a42c2305eccb8d54e66c76eb2ae4eacfd81f941 (diff)
parent818437c3664039f7038364910fc4ac80450f36a2 (diff)
downloadrails-cab396f4238997421181057645ab13e552881208.tar.gz
rails-cab396f4238997421181057645ab13e552881208.tar.bz2
rails-cab396f4238997421181057645ab13e552881208.zip
Merge pull request #35572 from sharang-d/tests-for-transliterate-locale-arg
Add test for 'ActiveSupport::Inflector.transliterate'
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/string_ext_test.rb6
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)