From 7da736f929e88f4730f160d28afc90667c26b966 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 26 Jun 2005 12:03:43 +0000 Subject: Added script.aculo.us Javascripts (controls.js, dragdrop.js, effects.js) (NEEDS MORE DESCRIPTION) #1509 [Thomas Fuchs] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1522 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/javascript_helper.rb | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'actionpack/test/template/javascript_helper.rb') diff --git a/actionpack/test/template/javascript_helper.rb b/actionpack/test/template/javascript_helper.rb index e8395e6753..f70703c819 100644 --- a/actionpack/test/template/javascript_helper.rb +++ b/actionpack/test/template/javascript_helper.rb @@ -16,6 +16,11 @@ class JavascriptHelperTest < Test::Unit::TestCase end @controller = @controller.new end + + def test_define_javascript_functions + # check if prototype.js is included first + assert_not_nil define_javascript_functions.split("\n")[1].match(/Prototype: an object-oriented Javascript library/) + end def test_escape_javascript assert_equal %(This \\"thing\\" is really\\n netos\\'), escape_javascript(%(This "thing" is really\n netos')) @@ -39,7 +44,7 @@ class JavascriptHelperTest < Test::Unit::TestCase end def test_form_remote_tag - assert_equal %(
), + assert_equal %(), form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast }) end @@ -58,4 +63,21 @@ class JavascriptHelperTest < Test::Unit::TestCase observe_form("cart", :frequency => 2, :url => { :action => "cart_changed" }) end + def test_remote_autocomplete + assert_equal %(), + remote_autocomplete("some_input", :url => { :action => "autocomplete" }); + end + + def test_effect + assert_equal "new Effect.Highlight('posts',{});", visual_effect(:highlight, "posts") + assert_equal "new Effect.Highlight('posts',{});", visual_effect("highlight", :posts) + assert_equal "new Effect.Highlight('posts',{});", visual_effect(:highlight, :posts) + assert_equal "new Effect.Fade('fademe',{duration:4.0});", visual_effect(:fade, "fademe", :duration => 4.0) + end + + def test_remote_sortable + assert_equal %(), + remote_sortable("mylist", :url => { :action => "order" }) + end + end -- cgit v1.2.3