Commit | Line | Data |
11e7af55 |
1 | #!perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use FindBin; |
7 | use lib "$FindBin::Bin/../lib"; |
8 | |
9 | use Test::More tests => 8; |
10 | use Catalyst::Test 'TestApp'; |
11 | |
12 | use Catalyst::Request; |
13 | use HTTP::Headers; |
14 | use HTTP::Request::Common; |
15 | |
16 | { |
17 | my $creq; |
18 | |
19 | my $parameters = { 'a' => [qw(A b C d E f G)], }; |
20 | |
21 | my $query = join( '&', map { 'a=' . $_ } @{ $parameters->{a} } ); |
22 | |
23 | ok( my $response = request("http://localhost/dump/prepare_parameters?$query"), |
24 | 'Request' ); |
25 | ok( $response->is_success, 'Response Successful 2xx' ); |
26 | is( $response->content_type, 'text/plain', 'Response Content-Type' ); |
27 | like( |
28 | $response->content, |
29 | qr/^bless\( .* 'Catalyst::Request' \)$/s, |
30 | 'Content is a serialized Catalyst::Request' |
31 | ); |
32 | ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ); |
33 | isa_ok( $creq, 'Catalyst::Request' ); |
34 | is( $creq->method, 'GET', 'Catalyst::Request method' ); |
35 | is_deeply( $creq->parameters, $parameters, |
36 | 'Catalyst::Request parameters' ); |
37 | } |
38 | |
39 | |