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