diff options
author | Xavier Noria <fxn@hashref.com> | 2011-08-31 04:27:59 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-31 04:27:59 -0700 |
commit | 47b8415bef7edb25bb750685d6f9331f044bbd80 (patch) | |
tree | e408066b7c5df43b2e1b2fbc4f0ff5478f5efdab /actionpack/test/template/javascript_helper_test.rb | |
parent | 6d772c0953b418da774b2c3bf5cc297508669da7 (diff) | |
parent | e746c4047cd34accd7f63aa5d09cbb35011c24e2 (diff) | |
download | rails-47b8415bef7edb25bb750685d6f9331f044bbd80.tar.gz rails-47b8415bef7edb25bb750685d6f9331f044bbd80.tar.bz2 rails-47b8415bef7edb25bb750685d6f9331f044bbd80.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/test/template/javascript_helper_test.rb')
-rw-r--r-- | actionpack/test/template/javascript_helper_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb index dd8b7b7cd5..4b9c3c97b1 100644 --- a/actionpack/test/template/javascript_helper_test.rb +++ b/actionpack/test/template/javascript_helper_test.rb @@ -1,4 +1,5 @@ require 'abstract_unit' +require 'active_support/core_ext/string/encoding' class JavaScriptHelperTest < ActionView::TestCase tests ActionView::Helpers::JavaScriptHelper @@ -27,6 +28,11 @@ class JavaScriptHelperTest < ActionView::TestCase 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)) + if "ruby".encoding_aware? + assert_equal %(unicode 
 newline), escape_javascript(%(unicode \342\200\250 newline).force_encoding('UTF-8').encode!) + else + assert_equal %(unicode 
 newline), escape_javascript(%(unicode \342\200\250 newline)) + end assert_equal %(dont <\\/close> tags), j(%(dont </close> tags)) end |