shlist

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

list_join_unit.t (621B)


      1 use strict;
      2 use Test;
      3 use SL::Test;
      4 
      5 BEGIN { plan tests => 9 }
      6 
      7 my $s = SL::Test::Server->new();
      8 my $A = SL::Test::Client->new();
      9 
     10 # Try joining a list that doesn't exist
     11 my $err = $A->list_join('12345678', 'err');
     12 ok($err, 'the client sent an unknown list number');
     13 ok($s->readline(), "/unknown list number '.*'/");
     14 
     15 # Test joining a list your already in
     16 my $list = $A->list_add({ name => 'my new test list', date => 0 });
     17 $err = $A->list_join($list->{num}, 'err');
     18 ok($err, 'the device is already part of this list');
     19 ok($s->readline(), "/tried to create a duplicate list member entry for device '.*' and list '.*'/");