From 7815fe4634fcb255583631fa84b50aeeeab0d51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 20 Mar 2015 17:58:54 -0300 Subject: Merge pull request #19421 from jcoyne/translate_defaults_with_nil Strip nils out of default translations. Fixes #19419 --- actionview/test/template/translation_helper_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionview/test') 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) -- cgit v1.2.3