X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/aa6f2f886d78c6cf42ee284ded1ce3cd3db1c632..e9aaa095a1136966a7fcca4877882736770ac119:/test/functional/quickvote_controller_test.rb 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