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

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

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

revision 951 by dpavlin, Wed Oct 31 10:34:38 2007 UTC revision 952 by dpavlin, Thu Nov 1 00:17:49 2007 UTC
# Line 8  A (very) basic test harness for the Sear Line 8  A (very) basic test harness for the Sear
8    
9  =cut  =cut
10    
11  use Jifty::Test tests => 1;  use Jifty::Test tests => 7;
12    
13  # Make sure we can load the action  # Make sure we can load the action
14  use_ok('Webpacus::Action::Search');  use_ok('Webpacus::Action::Search');
15    
16    # 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";

Legend:
Removed from v.951  
changed lines
  Added in v.952

  ViewVC Help
Powered by ViewVC 1.1.26