Merge branch 'topic/evilstash'
[catagits/Catalyst-Runtime.git] / t / undef_encoding_regression.t
1 use utf8;
2 use warnings;
3 use strict;
4 use Test::More;
5 use HTTP::Request::Common;
6 use HTTP::Message::PSGI ();
7 use Encode 2.21 'decode_utf8', 'encode_utf8', 'encode';
8
9 {
10   package MyApp::Controller::Root;
11   $INC{'MyApp/Controller/Root.pm'} = __FILE__;
12
13   use base 'Catalyst::Controller';
14
15   sub heart :Local Args(1) {
16     my ($self, $c, $arg) = @_;
17
18     Test::More::is $c->req->query_parameters->{a}, 111;
19     Test::More::is $c->req->query_parameters->{b}, 222;
20     Test::More::is $arg, 1;
21
22     $c->response->content_type('text/html');
23     $c->response->body("<p>This is path local</p>");
24   }
25
26   package MyApp;
27   use Catalyst;
28
29   MyApp->config(encoding => undef);
30
31   Test::More::ok(MyApp->setup, 'setup app');
32 }
33
34 use Catalyst::Test 'MyApp';
35
36 {
37   my $res = request "/root/heart/1?a=111&b=222";
38   is $res->code, 200, 'OK';
39   is $res->content, '<p>This is path local</p>';
40 }
41
42 done_testing;