shlist

share and manage lists between multiple people
Log | Files | Refs

lists_get.t (785B)


      1 use strict;
      2 use Test;
      3 use SL::Test;
      4 
      5 BEGIN { plan tests => 28 }
      6 
      7 my $s = SL::Test::Server->new();
      8 my $A = SL::Test::Client->new();
      9 
     10 # Create 3 new lists
     11 my @stored_lists;
     12 for ('new list 1', 'new list 2', 'new list 3') {
     13 	push @stored_lists, $A->list_add({ name => $_, date => 0 });
     14 }
     15 
     16 my $i = 0;
     17 # Verify the information from lists_get matches what we know is true
     18 for my $list (@{ $A->lists_get() }) {
     19 	my $num = $list->{num};
     20 	my $stored_list = $stored_lists[$i];
     21 
     22 	ok( $list->{num}, $stored_list->{num} );
     23 	ok( $list->{num_members}, $stored_list->{num_members} );
     24 	ok( $list->{members}->[0], $A->phnum );
     25 	ok( $list->{name}, $stored_list->{name} );
     26 	ok( $list->{date}, $stored_list->{date} );
     27 	ok( $list->{items_total}, 0 );
     28 	ok( $list->{items_complete}, 0 );
     29 	$i++;
     30 }
     31 ok( $i, 3 );