X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/aa6f2f886d78c6cf42ee284ded1ce3cd3db1c632..796f9d2f4d178419346feae82f3b3f7d30c5b2b2:/test/functional/quickvote_controller_test.rb?ds=sidebyside 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