From 818437c3664039f7038364910fc4ac80450f36a2 Mon Sep 17 00:00:00 2001 From: Sharang Dashputre Date: Tue, 12 Mar 2019 00:39:58 +0530 Subject: Fix bug with parametrize when `locale` is passed Also add tests for parametrize and transliterate --- activesupport/test/core_ext/string_ext_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport/test/core_ext') 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) -- cgit v1.2.3