aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/prototype_helper_test.rb
diff options
context:
space:
mode:
authorThomas Fuchs <thomas@fesch.at>2006-09-07 09:19:35 +0000
committerThomas Fuchs <thomas@fesch.at>2006-09-07 09:19:35 +0000
commit8734da9bca3db5934f0d072feeca0b1724d082a7 (patch)
tree87e74e5a54561e3fd0aa6b46a04baa98ff0d5ec6 /actionpack/test/template/prototype_helper_test.rb
parent00685ad8fdc9f15d935aebe52597037f3ca93be8 (diff)
downloadrails-8734da9bca3db5934f0d072feeca0b1724d082a7.tar.gz
rails-8734da9bca3db5934f0d072feeca0b1724d082a7.tar.bz2
rails-8734da9bca3db5934f0d072feeca0b1724d082a7.zip
Update JavaScriptGenerator#show/hide/toggle/remove to new Prototype syntax for multiple ids, fixes #6068 [petermichaux@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5057 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/prototype_helper_test.rb')
-rw-r--r--actionpack/test/template/prototype_helper_test.rb17
1 files changed, 12 insertions, 5 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb
index 3954e38dcd..413999d85c 100644
--- a/actionpack/test/template/prototype_helper_test.rb
+++ b/actionpack/test/template/prototype_helper_test.rb
@@ -203,7 +203,7 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
end
def test_remove
- assert_equal '["foo"].each(Element.remove);',
+ assert_equal 'Element.remove("foo");',
@generator.remove('foo')
assert_equal '["foo", "bar", "baz"].each(Element.remove);',
@generator.remove('foo', 'bar', 'baz')
@@ -212,17 +212,24 @@ class JavaScriptGeneratorTest < Test::Unit::TestCase
def test_show
assert_equal 'Element.show("foo");',
@generator.show('foo')
- assert_equal 'Element.show("foo", "bar", "baz");',
- @generator.show('foo', 'bar', 'baz')
+ assert_equal '["foo", "bar", "baz"].each(Element.show);',
+ @generator.show('foo', 'bar', 'baz')
end
def test_hide
assert_equal 'Element.hide("foo");',
@generator.hide('foo')
- assert_equal 'Element.hide("foo", "bar", "baz");',
- @generator.hide('foo', 'bar', 'baz')
+ assert_equal '["foo", "bar", "baz"].each(Element.hide);',
+ @generator.hide('foo', 'bar', 'baz')
end
+ def test_toggle
+ assert_equal 'Element.toggle("foo");',
+ @generator.toggle('foo')
+ assert_equal '["foo", "bar", "baz"].each(Element.toggle);',
+ @generator.toggle('foo', 'bar', 'baz')
+ end
+
def test_alert
assert_equal 'alert("hello");', @generator.alert('hello')
end