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