source: server/trunk/web/t/controller_Search.t @ 158

Last change on this file since 158 was 158, checked in by nanardon, 13 years ago
  • factorize xml::rpc test code
  • add functions to test xml::rpc results (ie xml::rpc error code)
File size: 1.1 KB
Line 
1use strict;
2use warnings;
3use Test::More;
4use FindBin;
5require "$FindBin::Bin/xml.pl";
6
7my $pkgid = '45db73adf5f9ceabc8f9ea1dabccffcc';
8
9BEGIN { use_ok 'Catalyst::Test', 'Sophie' }
10BEGIN { use_ok 'Sophie::Controller::Search' }
11
12ok(
13    xmlrequest_ok('search.rpms.bydate', {}, time - 3600),
14    "search.rpms.bydate"
15);
16
17ok(
18    xmlrequest_ok('search.rpm.bypkgid', {}, $pkgid),
19    "search.rpm.bypkgid"
20);
21
22ok(
23    xmlrequest_ok('search.rpm.byname', {}, 'rpm', '>', '0'),
24    "search.rpm.byname"
25);
26
27ok(
28    xmlrequest_ok('search.rpm.bytag', {}, 'name', 'rpm'),
29    "search.rpm.bytag"
30);
31
32ok(
33    xmlrequest_ok('search.rpm.bydep', {}, 'P', 'rpm', '>', '0'),
34    "search.rpm.bydep"
35);
36
37ok(
38    xmlrequest_ok('search.rpm.byfile', {}, '/bin/rpm'),
39    "search.rpm.byfile"
40);
41
42ok(
43    xmlrequest_ok('search.rpm.fuzzy', {}, 'rpm-build'),
44    "search.rpm.fuzzy"
45);
46ok(
47    xmlrequest_ok('search.rpm.quick', {}, 'rpm-build'),
48    "search.rpm.quick"
49);
50
51
52ok(
53    xmlrequest_ok('search.rpm.description', {}, qw'rpm build'),
54    "search.rpm.description"
55);
56
57ok( request('/search')->is_success, 'Request should succeed' );
58done_testing();
Note: See TracBrowser for help on using the repository browser.