aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/translation_helper_test.rb
diff options
context:
space:
mode:
authorKir Shatrov <shatrov@me.com>2015-09-15 11:20:10 +0300
committerKir Shatrov <shatrov@me.com>2015-09-18 20:04:36 +0300
commit0f138d1a8b2b6b361e1fc1fea2bb927bce66b909 (patch)
tree395bbbb0cd7fcf19f69b93fb242b6f94b1b45d67 /actionview/test/template/translation_helper_test.rb
parenta8f4568f5396b68ae81eddc636604bb78bb6632a (diff)
downloadrails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.tar.gz
rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.tar.bz2
rails-0f138d1a8b2b6b361e1fc1fea2bb927bce66b909.zip
Include interpolation values to translation_missing helper
Diffstat (limited to 'actionview/test/template/translation_helper_test.rb')
-rw-r--r--actionview/test/template/translation_helper_test.rb6
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: &amp;quot; onclick=&amp;quot;alert()&amp;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