Commit | Line | Data |
dd4e6fd2 |
1 | #!perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use FindBin; |
9770ad56 |
7 | use lib "$FindBin::Bin/../../../lib"; |
dd4e6fd2 |
8 | |
d8c66af5 |
9 | use Test::More tests => 120; |
dd4e6fd2 |
10 | use Catalyst::Test 'TestApp'; |
11 | |
d8c66af5 |
12 | for ( 1 .. 10 ) { |
13 | { |
14 | ok( |
15 | my $response = |
16 | request('http://localhost/action/path/a path with spaces'), |
17 | 'Request' |
18 | ); |
19 | ok( $response->is_success, 'Response Successful 2xx' ); |
20 | is( $response->content_type, 'text/plain', 'Response Content-Type' ); |
21 | is( |
22 | $response->header('X-Catalyst-Action'), |
23 | 'action/path/a path with spaces', |
24 | 'Test Action' |
25 | ); |
26 | is( |
27 | $response->header('X-Test-Class'), |
28 | 'TestApp::Controller::Action::Path', |
29 | 'Test Class' |
30 | ); |
31 | like( |
32 | $response->content, |
33 | qr/^bless\( .* 'Catalyst::Request' \)$/s, |
34 | 'Content is a serialized Catalyst::Request' |
35 | ); |
36 | } |
dd4e6fd2 |
37 | |
d8c66af5 |
38 | { |
39 | ok( my $response = request('http://localhost/action/path/åäö'), |
40 | 'Request' ); |
41 | ok( $response->is_success, 'Response Successful 2xx' ); |
42 | is( $response->content_type, 'text/plain', 'Response Content-Type' ); |
43 | is( $response->header('X-Catalyst-Action'), |
44 | 'action/path/åäö', 'Test Action' ); |
45 | is( |
46 | $response->header('X-Test-Class'), |
47 | 'TestApp::Controller::Action::Path', |
48 | 'Test Class' |
49 | ); |
50 | like( |
51 | $response->content, |
52 | qr/^bless\( .* 'Catalyst::Request' \)$/s, |
53 | 'Content is a serialized Catalyst::Request' |
54 | ); |
55 | } |
dd4e6fd2 |
56 | } |