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

Contents of /t/00-action-ToggleEdit.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34 - (show annotations)
Fri Dec 14 14:39:05 2007 UTC (16 years, 4 months ago) by dpavlin
File MIME type: application/x-troff
File size: 821 byte(s)
more tweaks on toggle edit to make it (partially) working -- it
works in tests, but reports wrong message (?!)
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 =head1 DESCRIPTION
6
7 A (very) basic test harness for the ToggleEdit action.
8
9 =cut
10
11 use Jifty::Test tests => 20;
12 use Data::Dump qw/dump/;
13
14 # Make sure we can load the action
15 use_ok('Arh::Action::ToggleEdit');
16
17
18 ok( my $web = Jifty::Test->web, 'web' );
19
20 ok( $web->current_user->user_object->load_by_cols( email => 'admin@example.com' ), 'admin' );
21
22 ok( $web->current_user->editing, 'edit on' );
23
24 sub run_action {
25
26 ok(my $a = $web->new_action(
27 class => 'ToggleEdit',
28 ), 'new_action ToggleEdit');
29
30 ok( $a->run, 'run' );
31
32 ok( my $message = $a->result->message, 'message' );
33 diag dump($message);
34
35 if ( $message =~ m/off/ ) {
36 ok( ! $web->current_user->editing, 'edit off' );
37 } else {
38 ok( $web->current_user->editing, 'edit on' );
39 }
40
41 }
42
43 run_action foreach ( 1 .. 4 );
44

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26