/[SQLSession]/trunk/t/00-model-Role.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-Role.t

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

revision 102 by dpavlin, Sun Jan 21 12:41:35 2007 UTC revision 103 by dpavlin, Sat Feb 17 00:09:21 2007 UTC
# Line 2  Line 2 
2  use warnings;  use warnings;
3  use strict;  use strict;
4    
5    use blib;
6    
7  =head1 DESCRIPTION  =head1 DESCRIPTION
8    
9  A basic test harness for the Role model.  A basic test harness for the Role model.
# Line 19  ok($system_user, "Found a system user"); Line 21  ok($system_user, "Found a system user");
21    
22  # Try testing a create  # Try testing a create
23  my $o = SQLSession::Model::Role->new(current_user => $system_user);  my $o = SQLSession::Model::Role->new(current_user => $system_user);
24  my ($id) = $o->create();  my ($id) = $o->create(
25            user_id => 1,
26            role => 'student',
27    );
28  ok($id, "Role create returned success");  ok($id, "Role create returned success");
29  ok($o->id, "New Role has valid id set");  ok($o->id, "New Role has valid id set");
30  is($o->id, $id, "Create returned the right id");  is($o->id, $id, "Create returned the right id");
31    
32  # And another  # And another
33  $o->create();  $o->create(
34            user_id => 2,
35            role => 'student',
36    );
37  ok($o->id, "Role create returned another value");  ok($o->id, "Role create returned another value");
38  isnt($o->id, $id, "And it is different from the previous one");  isnt($o->id, $id, "And it is different from the previous one");
39    

Legend:
Removed from v.102  
changed lines
  Added in v.103

  ViewVC Help
Powered by ViewVC 1.1.26