- Fixed #15999 return a 500 response when message is empty, reported by Chris Dolan...
[catagits/HTTP-Request-AsCGI.git] / t / 08error.t
1 #!perl
2
3 use Test::More tests => 6;
4
5 use strict;
6 use warnings;
7
8 use IO::File;
9 use HTTP::Request;
10 use HTTP::Request::AsCGI;
11
12 my $response;
13
14 {
15     my $r = HTTP::Request->new( GET => 'http://www.host.com/' );
16     my $c = HTTP::Request::AsCGI->new($r);
17
18     $c->setup;
19
20     $response = $c->restore->response;
21 }
22
23 isa_ok( $response, 'HTTP::Response' );
24 is( $response->code, 500, 'Response Code' );
25 is( $response->message, 'Internal Server Error', 'Response Message' );
26 is( $response->protocol, 'HTTP/1.1', 'Response Protocol' );
27 is( $response->content_type, 'text/html', 'Response Content-Type' );
28 ok( length($response->content) > 0, 'Response Content' );