aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-05 16:35:27 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-05 16:35:27 +0000
commit5f724b516c6aef1206236d1842bae0032664eb33 (patch)
tree7411dac04eb591ddb171877aac6712856736d38d /actionpack
parent16b9409a9c087d26e415de9fe66b8a754d76e7f0 (diff)
downloadrails-5f724b516c6aef1206236d1842bae0032664eb33.tar.gz
rails-5f724b516c6aef1206236d1842bae0032664eb33.tar.bz2
rails-5f724b516c6aef1206236d1842bae0032664eb33.zip
Fixed tests (closes #4087) [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/new_render_test.rb11
-rw-r--r--actionpack/test/template/scriptaculous_helper_test.rb23
2 files changed, 29 insertions, 5 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 1ae742d5ac..febb4023d3 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -178,6 +178,17 @@ class NewRenderTestController < ActionController::Base
render :action => "potential_conflicts"
end
+ def enum_rjs_test
+ render :update do |page|
+ page.select('.product').each do |value|
+ page.visual_effect :highlight
+ page.visual_effect :highlight, value
+ page.sortable(value, :url => { :action => "order" })
+ page.draggable(value)
+ end
+ end
+ end
+
def delete_with_js
@project_id = 4
end
diff --git a/actionpack/test/template/scriptaculous_helper_test.rb b/actionpack/test/template/scriptaculous_helper_test.rb
index 8ae45af50c..3538ee0c6b 100644
--- a/actionpack/test/template/scriptaculous_helper_test.rb
+++ b/actionpack/test/template/scriptaculous_helper_test.rb
@@ -28,12 +28,25 @@ class ScriptaculousHelperTest < Test::Unit::TestCase
assert_equal "new Effect.Fade(\"fademe\",{duration:4.0});", visual_effect(:fade, "fademe", :duration => 4.0)
assert_equal "new Effect.Shake(element,{});", visual_effect(:shake)
assert_equal "new Effect.DropOut(\"dropme\",{queue:'end'});", visual_effect(:drop_out, 'dropme', :queue => :end)
- assert_equal "new Effect.DropOut(\"dropme\",{queue:{limit:2,scope:'test',position:'end'}});",
- visual_effect(:drop_out, 'dropme', :queue => {:position => "end", :scope => "test", :limit => 2})
- assert_equal "new Effect.DropOut(\"dropme\",{queue:{limit:2,scope:'list'}});",
- visual_effect(:drop_out, 'dropme', :queue => {:scope => :list, :limit => 2})
- assert_equal "new Effect.DropOut(\"dropme\",{queue:{limit:2,scope:'test',position:'end'}});",
+
+ # chop the queue params into a comma separated list
+ beginning, ending = 'new Effect.DropOut("dropme",{queue:{', '}});'
+ ve = [
+ visual_effect(:drop_out, 'dropme', :queue => {:position => "end", :scope => "test", :limit => 2}),
+ visual_effect(:drop_out, 'dropme', :queue => {:scope => :list, :limit => 2}),
visual_effect(:drop_out, 'dropme', :queue => {:position => :end, :scope => :test, :limit => 2})
+ ].collect { |v| v[beginning.length..-ending.length-1].split(',') }
+
+ assert ve[0].include?("limit:2")
+ assert ve[0].include?("scope:'test'")
+ assert ve[0].include?("position:'end'")
+
+ assert ve[1].include?("limit:2")
+ assert ve[1].include?("scope:'list'")
+
+ assert ve[2].include?("limit:2")
+ assert ve[2].include?("scope:'test'")
+ assert ve[2].include?("position:'end'")
end
def test_toggle_effects