aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/prototype_helper_test.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-10-29 00:18:43 +0000
committerRick Olson <technoweenie@gmail.com>2007-10-29 00:18:43 +0000
commitc708346688ee3cdd5583795ccd9b10590abd36b1 (patch)
tree52d87dcb213eef844ed0b4447d6cfbb0019d59f9 /actionpack/test/template/prototype_helper_test.rb
parentdf0765d8dc013ccd399d994109eaf39be4c24e81 (diff)
downloadrails-c708346688ee3cdd5583795ccd9b10590abd36b1.tar.gz
rails-c708346688ee3cdd5583795ccd9b10590abd36b1.tar.bz2
rails-c708346688ee3cdd5583795ccd9b10590abd36b1.zip
Change JSON to encode %w(< > &) as 4 digit hex codes to be in compliance with the JSON spec. Closes #9975 [josh, chuyeow, tpope]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/prototype_helper_test.rb')
-rw-r--r--actionpack/test/template/prototype_helper_test.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb
index bdb7a848a0..6caf67810c 100644
--- a/actionpack/test/template/prototype_helper_test.rb
+++ b/actionpack/test/template/prototype_helper_test.rb
@@ -303,23 +303,23 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
end
def test_insert_html_with_string
- assert_equal 'new Insertion.Top("element", "\\074p\\076This is a test\\074\\/p\\076");',
+ assert_equal 'new Insertion.Top("element", "\\u003Cp\\u003EThis is a test\\u003C\\/p\\u003E");',
@generator.insert_html(:top, 'element', '<p>This is a test</p>')
- assert_equal 'new Insertion.Bottom("element", "\\074p\076This is a test\\074\\/p\076");',
+ assert_equal 'new Insertion.Bottom("element", "\\u003Cp\u003EThis is a test\\u003C\\/p\u003E");',
@generator.insert_html(:bottom, 'element', '<p>This is a test</p>')
- assert_equal 'new Insertion.Before("element", "\\074p\076This is a test\\074\\/p\076");',
+ assert_equal 'new Insertion.Before("element", "\\u003Cp\u003EThis is a test\\u003C\\/p\u003E");',
@generator.insert_html(:before, 'element', '<p>This is a test</p>')
- assert_equal 'new Insertion.After("element", "\\074p\076This is a test\\074\\/p\076");',
+ assert_equal 'new Insertion.After("element", "\\u003Cp\u003EThis is a test\\u003C\\/p\u003E");',
@generator.insert_html(:after, 'element', '<p>This is a test</p>')
end
def test_replace_html_with_string
- assert_equal 'Element.update("element", "\\074p\\076This is a test\\074\\/p\\076");',
+ assert_equal 'Element.update("element", "\\u003Cp\\u003EThis is a test\\u003C\\/p\\u003E");',
@generator.replace_html('element', '<p>This is a test</p>')
end
def test_replace_element_with_string
- assert_equal 'Element.replace("element", "\\074div id=\"element\"\\076\\074p\\076This is a test\\074\\/p\\076\\074\\/div\\076");',
+ assert_equal 'Element.replace("element", "\\u003Cdiv id=\"element\"\\u003E\\u003Cp\\u003EThis is a test\\u003C\\/p\\u003E\\u003C\\/div\\u003E");',
@generator.replace('element', '<div id="element"><p>This is a test</p></div>')
end
@@ -375,10 +375,10 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
@generator.replace_html('baz', '<p>This is a test</p>')
assert_equal <<-EOS.chomp, @generator.to_s
-new Insertion.Top("element", "\\074p\\076This is a test\\074\\/p\\076");
-new Insertion.Bottom("element", "\\074p\\076This is a test\\074\\/p\\076");
+new Insertion.Top("element", "\\u003Cp\\u003EThis is a test\\u003C\\/p\\u003E");
+new Insertion.Bottom("element", "\\u003Cp\\u003EThis is a test\\u003C\\/p\\u003E");
["foo", "bar"].each(Element.remove);
-Element.update("baz", "\\074p\\076This is a test\\074\\/p\\076");
+Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C\\/p\\u003E");
EOS
end