diff options
author | Thomas Fuchs <thomas@fesch.at> | 2006-02-26 14:20:21 +0000 |
---|---|---|
committer | Thomas Fuchs <thomas@fesch.at> | 2006-02-26 14:20:21 +0000 |
commit | d11f8d551640c94e22c221c3bee39ab572b1dc72 (patch) | |
tree | 731a29bbd880d42dc1c169779d0a7fa9a37cd93f /actionpack/test | |
parent | 6a83ebfe703e922c4b0e2333521ed23208003f13 (diff) | |
download | rails-d11f8d551640c94e22c221c3bee39ab572b1dc72.tar.gz rails-d11f8d551640c94e22c221c3bee39ab572b1dc72.tar.bz2 rails-d11f8d551640c94e22c221c3bee39ab572b1dc72.zip |
Added script.aculo.us drag and drop helpers to RJS [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index 326363dc58..5a4ec61b39 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -3,6 +3,7 @@ require File.dirname(__FILE__) + '/../abstract_unit' module BaseTest include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::PrototypeHelper + include ActionView::Helpers::ScriptaculousHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper @@ -255,4 +256,29 @@ Element.update("baz", "<p>This is a test</p>"); @generator.select('p.welcome b').first.hide assert_equal %($$('p.welcome b').first().hide();), @generator.to_s end + + def test_visual_effect + assert_equal %(new Effect.Puff('blah',{});), + @generator.visual_effect(:puff,'blah') + end + + def test_visual_effect_toggle + assert_equal %(Effect.toggle('blah','appear',{});), + @generator.visual_effect(:toggle_appear,'blah') + end + + def test_sortable + assert_equal %(Sortable.create('blah', {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize('blah')})}});), + @generator.sortable('blah', :url => { :action => "order" }) + end + + def test_draggable + assert_equal %(new Draggable('blah', {});), + @generator.draggable('blah') + end + + def test_drop_receiving + assert_equal %(Droppables.add('blah', {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});), + @generator.drop_receiving('blah', :url => { :action => "order" }) + end end
\ No newline at end of file |