def test_create_quickvote
post(:create, {'commit' =>"Create Quickvote", 'quickvote' =>{'name' =>"variable", 'description' =>"Favorite variable."}}, nil, {:candlist=>["foo", "bar", "foobar"]})
- assert_response :success
+ assert_template "quickvote/success"
get :index, { 'ident' => "variable"}
assert_response :success
end
+ def test_create_quickvote_badname
+ post(:create, {'commit' => "Create Quickvote", 'quickvote' => {'name' => "has a space", 'description' => "Foobar"}}, nil, {:candlist => ["foo", "bar", "foobar"]})
+ assert_template "quickvote/create"
+ end
+
+ def test_create_quickvote_dupe_candidate
+ post(:create, {'commit' => "Create Quickvote", 'quickvote' => {'name' => "has a space", 'description' => "Foobar"}}, nil, {:candlist => ["foo", "bar", "bar", "foobar"]})
+ assert_template "quickvote/create"
+ end
+
def test_get_quickvote_nonexistent
get :index, { 'ident' => "idontexist" }
assert_redirected_to :controller => 'site'