diff options
author | Kir Shatrov <shatrov@me.com> | 2015-09-15 11:20:10 +0300 |
---|---|---|
committer | Kir Shatrov <shatrov@me.com> | 2015-09-18 20:04:36 +0300 |
commit | 0f138d1a8b2b6b361e1fc1fea2bb927bce66b909 (patch) | |
tree | 395bbbb0cd7fcf19f69b93fb242b6f94b1b45d67 /actionview/test | |
parent | a8f4568f5396b68ae81eddc636604bb78bb6632a (diff) | |
download | rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.tar.gz rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.tar.bz2 rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.zip |
Include interpolation values to translation_missing helper
Diffstat (limited to 'actionview/test')
-rw-r--r-- | actionview/test/template/translation_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionview/test/template/translation_helper_test.rb b/actionview/test/template/translation_helper_test.rb index 749d0dd7fd..261576bead 100644 --- a/actionview/test/template/translation_helper_test.rb +++ b/actionview/test/template/translation_helper_test.rb @@ -60,6 +60,12 @@ class TranslationHelperTest < ActiveSupport::TestCase assert_equal true, translate(:"translations.missing").html_safe? end + def test_returns_missing_translation_message_with_unescaped_interpolation + expected = '<span class="translation_missing" title="translation missing: en.translations.missing, name: Kir, year: 2015, vulnerable: &quot; onclick=&quot;alert()&quot;">Missing</span>' + assert_equal expected, translate(:"translations.missing", name: "Kir", year: "2015", vulnerable: %{" onclick="alert()"}) + assert translate(:"translations.missing").html_safe? + end + def test_raises_missing_translation_message_with_raise_config_option ActionView::Base.raise_on_missing_translations = true |