Fixed tests (closes #4087) [Rick Olson]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3773 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 16b9409a
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册