/[Arh]/t/00-action-ToggleEdit.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 /t/00-action-ToggleEdit.t

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

revision 23 by dpavlin, Fri Nov 30 23:23:14 2007 UTC revision 34 by dpavlin, Fri Dec 14 14:39:05 2007 UTC
# Line 8  A (very) basic test harness for the Togg Line 8  A (very) basic test harness for the Togg
8    
9  =cut  =cut
10    
11  use Jifty::Test tests => 10;  use Jifty::Test tests => 20;
12  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
13    
14  # Make sure we can load the action  # Make sure we can load the action
# Line 19  ok( my $web = Jifty::Test->web, 'web' ); Line 19  ok( my $web = Jifty::Test->web, 'web' );
19    
20  ok( $web->current_user->user_object->load_by_cols( email => 'admin@example.com' ), 'admin' );  ok( $web->current_user->user_object->load_by_cols( email => 'admin@example.com' ), 'admin' );
21    
22  ok( ! $web->current_user->editing, 'edit off' );  ok( $web->current_user->editing, 'edit on' );
23    
24  sub run_action {  sub run_action {
25    
# Line 29  sub run_action { Line 29  sub run_action {
29    
30          ok( $a->run, 'run' );          ok( $a->run, 'run' );
31    
32  }          ok( my $message = $a->result->message, 'message' );
33            diag dump($message);
34    
35  run_action;          if ( $message =~ m/off/ ) {
36  ok( $web->current_user->editing, 'edit on' );                  ok( ! $web->current_user->editing, 'edit off' );
37            } else {
38                    ok( $web->current_user->editing, 'edit on' );
39            }
40    
41    }
42    
43  run_action;  run_action foreach ( 1 .. 4 );
 ok( ! $web->current_user->editing, 'edit off' );  
44    

Legend:
Removed from v.23  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26