aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-09-21 17:06:45 -0400
committerGitHub <noreply@github.com>2018-09-21 17:06:45 -0400
commit013749ecff3ac77ae7ffda35bb54a90d786b64f9 (patch)
tree9f17c7db4d5448d3f39e6ada95e5d45027efffef /actionview/test/template
parent6fd9298272518f4a25a1494b1b1c860bda2dd6b4 (diff)
parentdd0cfb03b233e23b13e087f1cd39169b1ff6d936 (diff)
downloadrails-013749ecff3ac77ae7ffda35bb54a90d786b64f9.tar.gz
rails-013749ecff3ac77ae7ffda35bb54a90d786b64f9.tar.bz2
rails-013749ecff3ac77ae7ffda35bb54a90d786b64f9.zip
Merge pull request #33564 from avit/escape_javascript_casting
Let escape_javascript handle conversion to string
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/javascript_helper_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/javascript_helper_test.rb b/actionview/test/template/javascript_helper_test.rb
index a72bc6c2fe..80de541bf1 100644
--- a/actionview/test/template/javascript_helper_test.rb
+++ b/actionview/test/template/javascript_helper_test.rb
@@ -23,6 +23,10 @@ class JavaScriptHelperTest < ActionView::TestCase
def test_escape_javascript
assert_equal "", escape_javascript(nil)
+ assert_equal "123", escape_javascript(123)
+ assert_equal "en", escape_javascript(:en)
+ assert_equal "false", escape_javascript(false)
+ assert_equal "true", escape_javascript(true)
assert_equal %(This \\"thing\\" is really\\n netos\\'), escape_javascript(%(This "thing" is really\n netos'))
assert_equal %(backslash\\\\test), escape_javascript(%(backslash\\test))
assert_equal %(dont <\\/close> tags), escape_javascript(%(dont </close> tags))