--- t/00-action-ToggleEdit.t 2007/11/30 23:23:14 23 +++ t/00-action-ToggleEdit.t 2007/12/14 14:39:05 34 @@ -8,7 +8,7 @@ =cut -use Jifty::Test tests => 10; +use Jifty::Test tests => 20; use Data::Dump qw/dump/; # Make sure we can load the action @@ -19,7 +19,7 @@ ok( $web->current_user->user_object->load_by_cols( email => 'admin@example.com' ), 'admin' ); -ok( ! $web->current_user->editing, 'edit off' ); +ok( $web->current_user->editing, 'edit on' ); sub run_action { @@ -29,11 +29,16 @@ ok( $a->run, 'run' ); -} + ok( my $message = $a->result->message, 'message' ); + diag dump($message); -run_action; -ok( $web->current_user->editing, 'edit on' ); + if ( $message =~ m/off/ ) { + ok( ! $web->current_user->editing, 'edit off' ); + } else { + ok( $web->current_user->editing, 'edit on' ); + } + +} -run_action; -ok( ! $web->current_user->editing, 'edit off' ); +run_action foreach ( 1 .. 4 );