X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/ffec26b00fc14b92f82137e1e3c62ce78c93ea24..7065ec58c26803b9fbc99476c09c1599996f4cc1:/test/functional/quickvote_controller_test.rb?ds=inline
diff --git a/test/functional/quickvote_controller_test.rb b/test/functional/quickvote_controller_test.rb
index ee79b3f..e116c0d 100644
--- a/test/functional/quickvote_controller_test.rb
+++ b/test/functional/quickvote_controller_test.rb
@@ -43,24 +43,24 @@ class QuickvoteControllerTest < Test::Unit::TestCase
def test_create_quickvote_badname
post(:create, {'commit' => "Create Quickvote", 'quickvote' => {'name' => "has a space", 'description' => "Foobar"}}, nil, {:candidate_names => ["foo", "bar", "foobar"]})
- assert_template "quickvote/create"
+ assert_template "quickvote/_create_sidebar"
end
def test_create_quickvote_dupe_candidate
post(:create, {'commit' => "Create Quickvote", 'quickvote' => {'name' => "has a space", 'description' => "Foobar"}}, nil, {:candidate_names => ["foo", "bar", "bar", "foobar"]})
- assert_template "quickvote/create"
+ assert_template "quickvote/_create_sidebar"
end
def test_create_quickvote_nil_candidate
post(:create, {'commit' => "Create Quickvote", 'quickvote' => {'name' => "has a space", 'description' => "Foobar"}}, nil, {:candidate_names => nil})
- assert_template "quickvote/create"
+ assert_template "quickvote/_create_sidebar"
post(:create, {'commit' => "Create Quickvote", 'quickvote' => {'name' => "has a space", 'description' => "Foobar"}}, nil, {:candidate_names => []})
- assert_template "quickvote/create"
+ assert_template "quickvote/_create_sidebar"
end
def test_get_quickvote_nonexistent
get :index, { 'ident' => "idontexist" }
- assert_redirected_to :controller => 'site'
+ assert_redirected_to :controller => 'front'
end
def test_get_result_empty_vote
@@ -72,7 +72,7 @@ class QuickvoteControllerTest < Test::Unit::TestCase
def test_get_result_nonexistent
test_create_quickvote
get :results, { 'ident' => 'asdflaksdjf' }
- assert_redirected_to :controller => 'site'
+ assert_redirected_to :controller => 'front'
end
def test_get_result_with_a_vote
@@ -115,24 +115,40 @@ 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
+ # create quickvote with tainted data
test_create_quickvote
qv=QuickVote.ident_to_quickvote('variable')
qv.description=""
- qv.candidate_names = ["