diff options
author | miloops <miloops@gmail.com> | 2008-07-22 11:13:38 -0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-30 01:42:32 -0700 |
commit | eaab895f83276674891227c656df9b4cebc50200 (patch) | |
tree | 04abcb82319b12701ca8690dc829a9fe6b375e98 /actionpack/test/template | |
parent | c8e80f6389b45134c0514dde6736488cf5507765 (diff) | |
download | rails-eaab895f83276674891227c656df9b4cebc50200.tar.gz rails-eaab895f83276674891227c656df9b4cebc50200.tar.bz2 rails-eaab895f83276674891227c656df9b4cebc50200.zip |
Prototype helpers should generate Element.insert instead of Insertion.new, which has been deprecated in Prototype 1.6.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 12 |
1 files changed, 6 insertions, 6 deletions
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', '<p>This is a test</p>') - 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', '<p>This is a test</p>') - 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', '<p>This is a test</p>') - 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', '<p>This is a test</p>') end @@ -366,8 +366,8 @@ class JavaScriptGeneratorTest < PrototypeHelperBaseTest @generator.replace_html('baz', '<p>This is a test</p>') 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 |