Skip to content
Browse files

Fixed tests (closes #4087) [Rick Olson]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 16b9409 commit 5f724b516c6aef1206236d1842bae0032664eb33 @dhh dhh committed
View
11 actionpack/test/controller/new_render_test.rb
@@ -178,6 +178,17 @@ def @template.name() nil end
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
View
23 actionpack/test/template/scriptaculous_helper_test.rb
@@ -28,12 +28,25 @@ def test_effect
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

0 comments on commit 5f724b5

Please sign in to comment.
Something went wrong with that request. Please try again.