aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorPrem Sichanugrist <s@sikachu.com>2011-06-09 14:00:10 -0400
committerPrem Sichanugrist <s@sikachu.com>2011-06-09 14:30:02 -0400
commit8c8652c37f6f6969ce48d579a8c9a8ff668f995a (patch)
tree89783214af4fbf92f5ce9606c31804af65692faf /actionpack/test
parent834bebf9cc5acbf2c6662d1e5458a2726d305341 (diff)
downloadrails-8c8652c37f6f6969ce48d579a8c9a8ff668f995a.tar.gz
rails-8c8652c37f6f6969ce48d579a8c9a8ff668f995a.tar.bz2
rails-8c8652c37f6f6969ce48d579a8c9a8ff668f995a.zip
Make sure `escape_javascript` return `SafeBuffer` if the incoming argument is already html_safe
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/javascript_helper_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index 15bd6b4c47..dd8b7b7cd5 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -35,6 +35,8 @@ class JavaScriptHelperTest < ActionView::TestCase
expect = %(\\'quoted\\' \\"double-quoted\\" new-line:\\n <\\/closed>)
assert_equal expect, escape_javascript(given)
assert_equal expect, escape_javascript(ActiveSupport::SafeBuffer.new(given))
+ assert_instance_of String, escape_javascript(given)
+ assert_instance_of ActiveSupport::SafeBuffer, escape_javascript(ActiveSupport::SafeBuffer.new(given))
end
def test_button_to_function