+ def assert_cast_quickvote_succeeds(shortname, id, vote)
+ old_votes = invoke_delegated :vote, :get_quickvote_votes, shortname
+ assert_nothing_raised do
+ invoke_delegated :vote, :cast_quickvote, shortname, id, vote
+ end
+ new_votes = invoke_delegated :vote, :get_quickvote_votes, shortname
+ assert_equal old_votes.length, new_votes.length-1
+ assert_not_nil(reflection = new_votes.find_all { |v| v.voter_session_id == "XMLRPC:#{id}" })
+ assert_equal reflection.length, 1
+ assert_equal reflection[0].vote, vote[0]
+ end
+ def assert_cast_quickvote_fails(shortname, id, vote)
+ assert_raises Test::Unit::AssertionFailedError do
+ assert_cast_quickvote_succeeds(shortname, id, vote)
+ end
+ end