From 0fb2d1a0ba3360e928a7ac9d20378d7f5fbf915f Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Wed, 28 Oct 2015 21:52:33 +0100 Subject: Ignore scope in missing translation input. It's already represented in the key name. Demonstrate with a test. Also test that the default isn't output. --- actionview/test/template/translation_helper_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionview/test') diff --git a/actionview/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb index 261576bead..631bceadd8 100644 --- a/actionview/test/template/translation_helper_test.rb +++ b/actionview/test/template/translation_helper_test.rb @@ -66,6 +66,14 @@ class TranslationHelperTest < ActiveSupport::TestCase assert translate(:"translations.missing").html_safe? end + def test_returns_missing_translation_message_does_filters_out_i18n_options + expected = 'Missing' + assert_equal expected, translate(:"translations.missing", year: '2015', default: []) + + expected = 'Missing' + assert_equal expected, translate(:"translations.missing", year: '2015', scope: %i(scoped)) + end + def test_raises_missing_translation_message_with_raise_config_option ActionView::Base.raise_on_missing_translations = true -- cgit v1.2.3