From eaab895f83276674891227c656df9b4cebc50200 Mon Sep 17 00:00:00 2001 From: miloops Date: Tue, 22 Jul 2008 11:13:38 -0300 Subject: Prototype helpers should generate Element.insert instead of Insertion.new, which has been deprecated in Prototype 1.6. --- actionpack/test/template/prototype_helper_test.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actionpack/test/template/prototype_helper_test.rb') diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index 92cc85703b..eb3517ef91 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -287,13 +287,13 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest end def test_insert_html_with_string - assert_equal 'new Insertion.Top("element", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");', + assert_equal 'Element.insert("element", { top: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" });', @generator.insert_html(:top, 'element', '

This is a test

') - assert_equal 'new Insertion.Bottom("element", "\\u003Cp\u003EThis is a test\\u003C/p\u003E");', + assert_equal 'Element.insert("element", { bottom: "\\u003Cp\u003EThis is a test\\u003C/p\u003E" });', @generator.insert_html(:bottom, 'element', '

This is a test

') - assert_equal 'new Insertion.Before("element", "\\u003Cp\u003EThis is a test\\u003C/p\u003E");', + assert_equal 'Element.insert("element", { before: "\\u003Cp\u003EThis is a test\\u003C/p\u003E" });', @generator.insert_html(:before, 'element', '

This is a test

') - assert_equal 'new Insertion.After("element", "\\u003Cp\u003EThis is a test\\u003C/p\u003E");', + assert_equal 'Element.insert("element", { after: "\\u003Cp\u003EThis is a test\\u003C/p\u003E" });', @generator.insert_html(:after, 'element', '

This is a test

') end @@ -366,8 +366,8 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest @generator.replace_html('baz', '

This is a test

') assert_equal <<-EOS.chomp, @generator.to_s -new Insertion.Top("element", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E"); -new Insertion.Bottom("element", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E"); +Element.insert("element", { top: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" }); +Element.insert("element", { bottom: "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E" }); ["foo", "bar"].each(Element.remove); Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E"); EOS -- cgit v1.2.3