/[transports]/trunk/t/00-model-Transport.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/00-model-Transport.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by dpavlin, Fri May 5 12:36:45 2006 UTC revision 27 by dpavlin, Fri May 26 21:21:25 2006 UTC
# Line 10  A basic test harness for the Transport m Line 10  A basic test harness for the Transport m
10    
11  use Jifty::Test tests => 13;  use Jifty::Test tests => 13;
12    
13    my $nr = 7;
14    
15  # Make sure we can load the model  # Make sure we can load the model
16  use_ok('Transports::Model::Transport');  use_ok('Transports::Model::Transport');
17    
# Line 30  my ($id) = $o->create( Line 32  my ($id) = $o->create(
32          destination => $d_id,          destination => $d_id,
33          request_nr => 12345,          request_nr => 12345,
34          client_dependent => 0,          client_dependent => 0,
35            created_by => 1,
36  );  );
37  ok($id, "Transport create returned success");  ok($id, "Transport create returned success");
38  ok($o->id, "New Transport has valid id set");  ok($o->id, "New Transport has valid id set");
# Line 41  $o->create( Line 44  $o->create(
44          destination => $d_id,          destination => $d_id,
45          request_nr => 54321,          request_nr => 54321,
46          client_dependent => 1,          client_dependent => 1,
47            created_by => 1,
48  );  );
49  ok($o->id, "Transport create returned another value");  ok($o->id, "Transport create returned another value");
50  isnt($o->id, $id, "And it is different from the previous one");  isnt($o->id, $id, "And it is different from the previous one");
# Line 48  isnt($o->id, $id, "And it is different f Line 52  isnt($o->id, $id, "And it is different f
52  # Searches in general  # Searches in general
53  my $collection =  Transports::Model::TransportCollection->new(current_user => $system_user);  my $collection =  Transports::Model::TransportCollection->new(current_user => $system_user);
54  $collection->unlimit;  $collection->unlimit;
55  is($collection->count, 2, "Finds two records");  is($collection->count, $nr + 2, "Finds two records");
56    
57  # Searches in specific  # Searches in specific
58  $collection->limit(column => 'id', value => $o->id);  $collection->limit(column => 'id', value => $o->id);
# Line 61  is($collection->count, 0, "Deleted row i Line 65  is($collection->count, 0, "Deleted row i
65    
66  # And the other one is still there  # And the other one is still there
67  $collection->unlimit;  $collection->unlimit;
68  is($collection->count, 1, "Still one left");  is($collection->count, $nr + 1, "Still one left");
69    

Legend:
Removed from v.7  
changed lines
  Added in v.27

  ViewVC Help
Powered by ViewVC 1.1.26