source: trunk/t/10Vote_DB.t @ 201

Last change on this file since 201 was 201, checked in by nanardon, 15 years ago
  • start test over fictives poll
  • Property svn:keywords set to Id Rev
File size: 811 bytes
Line 
1use strict;
2use warnings;
3use Test::More;
4
5# $Id$
6
7my $test_polls = [
8# Structure:
9#    {
10#        poll => { var => $val }
11#        voting => [ qw(mail) ],
12#        ballot => {
13#        # signing from voting list
14#            signing => [ qw() ] # list of items
15#        },
16#    }
17    {}
18];
19
20plan tests =>
21    3                        # Fixed test
22    + scalar(@$test_polls) * # number of tested polls scenario
23    1;                       # per poll number of tests
24
25use_ok 'Vote', 'Vote';
26use_ok 'Vote::DB';
27
28$ENV{EPOLL_NO_COMMIT} = 1;
29
30isa_ok(my $vote = Vote::DB->new(Vote->config->{db}), 'Vote::DB');
31
32my $count = 0;
33foreach my $tpoll (@$test_polls) {
34    $count++;
35    ok(my $pollid = $vote->create_poll('test@', "Vote test $count", "password"),
36        "can create a new poll");
37
38    $vote->rollback;
39}
Note: See TracBrowser for help on using the repository browser.