/[webpac2]/Webpacus2/t/00-action-Search.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

Annotation of /Webpacus2/t/00-action-Search.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 952 - (hide annotations)
Thu Nov 1 00:17:49 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: application/x-troff
File size: 977 byte(s)
 r1442@llin:  dpavlin | 2007-10-31 23:59:45 +0100
 better test Search action

1 dpavlin 930 #!/usr/bin/env perl
2     use warnings;
3     use strict;
4    
5     =head1 DESCRIPTION
6    
7     A (very) basic test harness for the Search action.
8    
9     =cut
10    
11 dpavlin 952 use Jifty::Test tests => 7;
12 dpavlin 930
13     # Make sure we can load the action
14     use_ok('Webpacus::Action::Search');
15    
16 dpavlin 952 # Grab a system user
17     my $system_user = Webpacus::CurrentUser->superuser;
18     ok($system_user, "Found a system user");
19    
20     {
21     use Log::Log4perl::Level;
22     Jifty->web->log->level( $DEBUG );
23     }
24    
25     my $search = Jifty::Test->web->new_action(
26     class => 'Search',
27     moniker => 'search',
28     current_user => $system_user,
29     arguments => {}
30     );
31    
32     isa_ok($search, 'Webpacus::Action::Search');
33    
34     my %args = %{$search->arguments};
35    
36     ok($args{$_}, "arguments has $_") foreach ( 'field', 'query' );
37    
38     $search->argument_values({ feild => '', query => 'a' });
39     $search->run;
40    
41     my $results = $search->result->content('results');
42    
43     isa_ok($results, 'Webpacus::Search::Results');
44     cmp_ok($results->count, '>=', 1, 'count');
45    
46     diag "found ", $results->count, " results";

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26