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 |
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 |
|
|
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 |
|
|