update distar url
[catagits/Catalyst-Runtime.git] / t / more-psgi-compat.t
CommitLineData
4491e0cc 1use warnings;
2use strict;
3
4use FindBin;
5use Test::More;
6use HTTP::Request::Common;
7
8use lib "$FindBin::Bin/lib";
9use Catalyst::Test 'TestFromPSGI';
10
11{
12 ok my $response = request GET '/from_psgi_array',
13 'got welcome from a catalyst controller';
14
15 is $response->content, 'helloworldtoday',
16 'expected content body /from_psgi_array';
17}
18
19{
20 ok my $response = request GET '/from_psgi_code',
21 'got welcome from a catalyst controller';
22
23 is $response->content, 'helloworldtoday2',
24 'expected content body /from_psgi_code';
25}
26
27{
28 ok my $response = request GET '/from_psgi_code_itr',
29 'got welcome from a catalyst controller';
30
31 is $response->content, 'helloworldtoday3',
32 'expected content body /from_psgi_code_itr';
33}
34
88ba7793 35{
36 ok my($res, $c) = ctx_request(POST '/test_psgi_keys?a=1&b=2', [c=>3,d=>4]);
37
38 ok $c->req->env->{"psgix.input.buffered"}, "input is buffered";
29707b19 39
40 is $c->req->parameters->get('c'), 3;
41 is $c->req->parameters->get('d'), 4;
42 is $c->req->parameters->get('a'), 1;
43 is $c->req->parameters->get('b'), 2;
44
45 is $c->req->body_parameters->get('c'), 3;
46 is $c->req->body_parameters->get('d'), 4;
47 is $c->req->query_parameters->get('a'), 1;
48 is $c->req->query_parameters->get('b'), 2;
88ba7793 49}
50
4491e0cc 51done_testing;