7 use lib "$FindBin::Bin/lib";
9 use Test::More tests => 18;
10 use Catalyst::Test 'TestApp';
12 close STDERR; # i'm naughty :)
15 ok( my $response = request('http://localhost/engine/response/errors/one'), 'Request' );
16 ok( $response->is_error, 'Response Server Error 5xx' );
17 is( $response->code, 500, 'Response Code' );
18 is( $response->content_type, 'text/html', 'Response Content-Type' );
19 is( $response->header('X-Catalyst-Action'), 'engine/response/errors/one', 'Test Action' );
20 like( $response->header('X-Catalyst-Error'), qr/^Caught exception/, 'Catalyst Error' );
24 ok( my $response = request('http://localhost/engine/response/errors/two'), 'Request' );
25 ok( $response->is_error, 'Client Error 4xx' );
26 is( $response->code, 404, 'Response Code' );
27 is( $response->content_type, 'text/html', 'Response Content-Type' );
28 is( $response->header('X-Catalyst-Action'), 'engine/response/errors/two', 'Test Action' );
29 like( $response->header('X-Catalyst-Error'), qr/^Couldn't forward to/, 'Catalyst Error' );
33 ok( my $response = request('http://localhost/engine/response/errors/three'), 'Request' );
34 ok( $response->is_error, 'Response Server Error 5xx' );
35 is( $response->code, 500, 'Response Code' );
36 is( $response->content_type, 'text/html', 'Response Content-Type' );
37 is( $response->header('X-Catalyst-Action'), 'engine/response/errors/three', 'Test Action' );
38 like( $response->header('X-Catalyst-Error'), qr/^Caught exception "I'm going to die!"$/, 'Catalyst Error' );