aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/translation_helper_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-03-20 17:58:54 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-03-20 18:00:01 -0300
commit7815fe4634fcb255583631fa84b50aeeeab0d51e (patch)
tree3e5c3d5a5f37339b8ff35afe45eb13fb9acc4daa /actionview/test/template/translation_helper_test.rb
parent013b716f384a090f189ea7a98efd4c4171555454 (diff)
downloadrails-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/template/translation_helper_test.rb')
-rw-r--r--actionview/test/template/translation_helper_test.rb5
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)