Commit | Line | Data |
9c86666a |
1 | use utf8; |
2 | use warnings; |
3 | use strict; |
4 | |
5 | use Test::More; |
6 | use HTTP::Request::Common; |
7 | use Plack::Test; |
8 | |
9 | # Test cases for incoming utf8 |
10 | |
11 | { |
12 | package MyApp::Controller::Root; |
13 | $INC{'MyApp/Controller/Root.pm'} = __FILE__; |
14 | |
15 | use base 'Catalyst::Controller'; |
16 | |
17 | sub heart :Path('♥') { |
18 | my ($self, $c) = @_; |
19 | $c->response->body("This is the body"); |
20 | } |
21 | |
22 | sub hat :Path('^') { |
23 | my ($self, $c) = @_; |
24 | $c->response->body("This is the body"); |
25 | } |
26 | |
27 | sub base :Chained('/') CaptureArgs(0) { } |
28 | sub link :Chained('base') PathPart('♥') Args(0) { |
29 | my ($self, $c) = @_; |
30 | $c->response->body("This is the body"); |
31 | } |
32 | |
33 | package MyApp; |
34 | use Catalyst; |
35 | |
36 | Test::More::ok(MyApp->setup, 'setup app'); |
37 | } |
38 | |
39 | ok my $psgi = MyApp->psgi_app, 'build psgi app'; |
40 | |
41 | test_psgi $psgi, sub { |
42 | my $cb = shift; |
43 | #my $res = $cb->(GET "/root/test"); |
44 | #is $res->code, 200, 'OK'; |
45 | #is $res->content, 'This is the body', 'correct body'; |
46 | #is $res->content_length, 16, 'correct length'; |
47 | }; |
48 | |
49 | done_testing; |