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
RevLine 
[5]1use strict;
2use warnings;
3use Test::More;
[158]4use FindBin;
5require "$FindBin::Bin/xml.pl";
[5]6
[92]7my $pkgid = '45db73adf5f9ceabc8f9ea1dabccffcc';
8
[5]9BEGIN { use_ok 'Catalyst::Test', 'Sophie' }
10BEGIN { use_ok 'Sophie::Controller::Search' }
11
[92]12ok(
[158]13    xmlrequest_ok('search.rpms.bydate', {}, time - 3600),
[92]14    "search.rpms.bydate"
15);
16
17ok(
[158]18    xmlrequest_ok('search.rpm.bypkgid', {}, $pkgid),
[92]19    "search.rpm.bypkgid"
20);
21
22ok(
[158]23    xmlrequest_ok('search.rpm.byname', {}, 'rpm', '>', '0'),
[92]24    "search.rpm.byname"
25);
26
27ok(
[158]28    xmlrequest_ok('search.rpm.bytag', {}, 'name', 'rpm'),
[92]29    "search.rpm.bytag"
30);
31
32ok(
[158]33    xmlrequest_ok('search.rpm.bydep', {}, 'P', 'rpm', '>', '0'),
[92]34    "search.rpm.bydep"
35);
36
37ok(
[158]38    xmlrequest_ok('search.rpm.byfile', {}, '/bin/rpm'),
[92]39    "search.rpm.byfile"
40);
41
42ok(
[158]43    xmlrequest_ok('search.rpm.fuzzy', {}, 'rpm-build'),
[92]44    "search.rpm.fuzzy"
45);
46ok(
[158]47    xmlrequest_ok('search.rpm.quick', {}, 'rpm-build'),
[92]48    "search.rpm.quick"
49);
50
51
52ok(
[158]53    xmlrequest_ok('search.rpm.description', {}, qw'rpm build'),
[92]54    "search.rpm.description"
55);
56
[5]57ok( request('/search')->is_success, 'Request should succeed' );
58done_testing();
Note: See TracBrowser for help on using the repository browser.