diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-20 17:58:54 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-03-20 18:00:01 -0300 |
commit | 7815fe4634fcb255583631fa84b50aeeeab0d51e (patch) | |
tree | 3e5c3d5a5f37339b8ff35afe45eb13fb9acc4daa /actionview/test | |
parent | 013b716f384a090f189ea7a98efd4c4171555454 (diff) | |
download | rails-7815fe4634fcb255583631fa84b50aeeeab0d51e.tar.gz rails-7815fe4634fcb255583631fa84b50aeeeab0d51e.tar.bz2 rails-7815fe4634fcb255583631fa84b50aeeeab0d51e.zip |
Merge pull request #19421 from jcoyne/translate_defaults_with_nil
Strip nils out of default translations. Fixes #19419
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 ef4d13efa7..c4daaae221 100644 --- a/actionview/test/template/translation_helper_test.rb +++ b/actionview/test/template/translation_helper_test.rb @@ -190,6 +190,11 @@ class TranslationHelperTest < ActiveSupport::TestCase assert_equal 'A Generic String', translation end + def test_translate_with_array_of_defaults_with_nil + translation = translate(:'translations.missing', default: [:'also_missing', nil, 'A Generic String']) + assert_equal 'A Generic String', translation + end + def test_translate_does_not_change_options options = {} translate(:'translations.missing', options) |