From: John Dong Date: Mon, 20 Aug 2007 20:02:42 +0000 (-0400) Subject: Add test case for attempting to cast another vote with same sessid X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/d4a5eeb90abdaa3785698164249b00d80fa64634?ds=inline Add test case for attempting to cast another vote with same sessid --- diff --git a/test/functional/quickvote_controller_test.rb b/test/functional/quickvote_controller_test.rb index a390d94..076a104 100644 --- a/test/functional/quickvote_controller_test.rb +++ b/test/functional/quickvote_controller_test.rb @@ -100,4 +100,19 @@ class QuickvoteControllerTest < Test::Unit::TestCase post :confirm, { 'ident' => 'variable', 'rankings-list' => votes.sort_by {rand} } assert_template 'quickvote/thanks' end + + def test_cast_dupe_quickvote + test_create_quickvote + votes = QuickVote.ident_to_quickvote('variable').candidates.collect { |c| c.id} + get :index, { 'ident' => 'variable' } + assert_response :success + + post :confirm, { 'ident' => 'variable', 'rankings-list' => votes.sort_by {rand} } + assert_template 'quickvote/thanks' + + get :index, { 'ident' => 'variable' } + assert_response :success + post :confirm, { 'ident' => 'variable', 'rankings-list' => votes.sort_by {rand} } + assert_redirected_to :controller => 'quickvote', :ident => 'variable' + end end