7 use lib "$FindBin::Bin/../../lib";
9 use Test::More no_plan => 1;
10 use Catalyst::Test 'TestApp';
13 ok( my $response = request('http://localhost/engine/response/errors/one'), 'Request' );
14 ok( $response->is_error, 'Response Server Error 5xx' );
15 is( $response->code, 500, 'Response Code' );
16 is( $response->content_type, 'text/html', 'Response Content-Type' );
17 is( $response->header('X-Catalyst-Action'), 'engine/response/errors/one', 'Test Action' );
18 like( $response->header('X-Catalyst-Error'), qr/^Caught exception/, 'Catalyst Error' );
22 ok( my $response = request('http://localhost/engine/response/errors/two'), 'Request' );
23 ok( $response->is_error, 'Client Error 4xx' );
24 is( $response->code, 404, 'Response Code' );
25 is( $response->content_type, 'text/html', 'Response Content-Type' );
26 is( $response->header('X-Catalyst-Action'), 'engine/response/errors/two', 'Test Action' );
27 like( $response->header('X-Catalyst-Error'), qr/^Unknown resource/, 'Catalyst Error' );
31 ok( my $response = request('http://localhost/engine/response/errors/three'), 'Request' );
32 ok( $response->is_error, 'Response Server Error 5xx' );
33 is( $response->code, 500, 'Response Code' );
34 is( $response->content_type, 'text/html', 'Response Content-Type' );
35 is( $response->header('X-Catalyst-Action'), 'engine/response/errors/three', 'Test Action' );
36 like( $response->header('X-Catalyst-Error'), qr/^Caught exception "I'm going to die!"$/, 'Catalyst Error' );