diff options
author | Adam Prescott <adam@aprescott.com> | 2015-04-04 12:46:45 -0400 |
---|---|---|
committer | Adam Prescott <adam@aprescott.com> | 2015-04-04 12:46:45 -0400 |
commit | 6f3c65f6300f157e6ae5bfb839064383f3de11a9 (patch) | |
tree | b6f21a7dadd29437f4fa70561677f45b2f4285ec /actionview/test | |
parent | 191facc857bb4fb52078fb544c6bc1613a81cc80 (diff) | |
download | rails-6f3c65f6300f157e6ae5bfb839064383f3de11a9.tar.gz rails-6f3c65f6300f157e6ae5bfb839064383f3de11a9.tar.bz2 rails-6f3c65f6300f157e6ae5bfb839064383f3de11a9.zip |
Allow an array to be a default translation value.
4.2.1 introduced a change to the way `translate`/`t` works with an
option of `default: [[]]`. In 4.2.0, this would give a default value of
`[]`, but in 4.2.1, it leads to a missing translation.
`default: [[]]` is again allowed for cases where a default of `[]` is
needed.
This addresses GitHub issue 19640.
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/translation_helper_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionview/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb index c4daaae221..df096b3c3a 100644 --- a/actionview/test/template/translation_helper_test.rb +++ b/actionview/test/template/translation_helper_test.rb @@ -195,6 +195,11 @@ class TranslationHelperTest < ActiveSupport::TestCase assert_equal 'A Generic String', translation end + def test_translate_with_array_of_array_default + translation = translate(:'translations.missing', default: [[]]) + assert_equal [], translation + end + def test_translate_does_not_change_options options = {} translate(:'translations.missing', options) |