Commit | Line | Data |
ed4a2203 |
1 | #!/usr/bin/env perl |
2 | use strict; |
3 | use warnings; |
4 | |
5 | no warnings 'redefine'; |
6 | |
7 | use FindBin; |
8 | use lib "$FindBin::Bin/lib"; |
9 | |
10 | use Test::More; |
11 | use Catalyst::Test 'TestApp'; |
accfac7d |
12 | use HTTP::Request::Common; |
ed4a2203 |
13 | |
14 | |
15 | is get('/sigmatch/test/23'), 'signaturematching/int', 'integer argument dispatched correctly'; |
16 | is get('/sigmatch/test/foo'), 'signaturematching/str', 'string argument dispatched correctly'; |
17 | is get('/sigmatch/test/f00'), 'signaturematching/rest', 'no match leads to other dispatched action'; |
18 | |
accfac7d |
19 | is get('/sigmatch/opt_param?page=3'), 'page 3', 'query parameter'; |
20 | is get('/sigmatch/opt_param?page=9&other=foo'), 'page 9', 'additional query parameter'; |
21 | |
22 | is get('/sigmatch/req_param?page=7'), 'page 7', 'required query parameter'; |
23 | is get('/sigmatch/req_param'), 'no page', 'required query parameter fallback'; |
24 | |
25 | # TODO |
26 | #is get('/sigmatch/mid?page=3'), 'signaturematching/end_with_param', 'mid point with query parameter'; |
27 | #is get('/sigmatch/mid'), 'signaturematching/end_no_param', 'mid point without query parameter'; |
28 | |
29 | is get('/sigmatch/with_list?filter=3'), '3', 'list-forced query parameter'; |
30 | is get('/sigmatch/with_list'), '', 'list-forced empty query parameter list'; |
31 | is get('/sigmatch/with_list?filter=3&filter=5'), '3, 5', 'list-forced query parameter with multiple'; |
32 | is get('/sigmatch/with_list?filter=foo'), 'signaturematching/rest', 'invalid data in list-forced query'; |
33 | |
34 | is request(POST '/sigmatch/getpost', [id => 7])->content, 7, 'post request'; |
35 | |
ed4a2203 |
36 | done_testing; |