X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/a1379415812ddd0e464aa3304b6fbb57ccf3373d..6ea52ab5c0c29ce60f5a8ee2747eb52f47d5b884:/test/functional/quickvote_controller_test.rb diff --git a/test/functional/quickvote_controller_test.rb b/test/functional/quickvote_controller_test.rb index 076a104..02c133e 100644 --- a/test/functional/quickvote_controller_test.rb +++ b/test/functional/quickvote_controller_test.rb @@ -115,4 +115,24 @@ class QuickvoteControllerTest < Test::Unit::TestCase post :confirm, { 'ident' => 'variable', 'rankings-list' => votes.sort_by {rand} } assert_redirected_to :controller => 'quickvote', :ident => 'variable' end + def test_display_tainted_quickvote + test_create_quickvote + qv=QuickVote.ident_to_quickvote('variable') + qv.description="foo" + qv.candidatelist = ["foo", "bar", ""] + qv.save! + get :index, { 'ident' => 'variable' } + assert_response :success + assert_no_tag :tag => "object" + assert_no_tag :tag => "foobar" + votes = QuickVote.ident_to_quickvote('variable').candidates.collect { |c| c.id} + post :confirm, { 'ident' => 'variable', 'rankings-list' => votes.sort_by {rand} } + assert_template('quickvote/thanks') + assert_no_tag :tag => "object" + assert_no_tag :tag => "foobar" + get :results, { 'ident' => 'variable' } + assert_response :success + assert_no_tag :tag => "object" + assert_no_tag :tag => "foobar" + end end