Commit | Line | Data |
dd4e6fd2 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
42da66a9 |
5 | use lib "$FindBin::Bin/../lib"; |
dd4e6fd2 |
6 | |
c20bd9d9 |
7 | use Test::More tests => 18; |
dd4e6fd2 |
8 | use Catalyst::Test 'TestApp'; |
9 | |
d1cbffb4 |
10 | close STDERR; # i'm naughty :) |
ece55428 |
11 | |
dd4e6fd2 |
12 | { |
d1cbffb4 |
13 | ok( my $response = request('http://localhost/engine/response/errors/one'), |
14 | 'Request' ); |
dd4e6fd2 |
15 | ok( $response->is_error, 'Response Server Error 5xx' ); |
d1cbffb4 |
16 | is( $response->code, 500, 'Response Code' ); |
dd4e6fd2 |
17 | is( $response->content_type, 'text/html', 'Response Content-Type' ); |
d1cbffb4 |
18 | is( $response->header('X-Catalyst-Action'), |
19 | 'engine/response/errors/one', 'Test Action' ); |
20 | like( |
21 | $response->header('X-Catalyst-Error'), |
22 | qr/^Caught exception/, |
23 | 'Catalyst Error' |
24 | ); |
dd4e6fd2 |
25 | } |
26 | |
27 | { |
d1cbffb4 |
28 | ok( my $response = request('http://localhost/engine/response/errors/two'), |
29 | 'Request' ); |
30 | ok( $response->is_error, 'Response Server Error 5xx' ); |
31 | is( $response->code, 500, 'Response Code' ); |
dd4e6fd2 |
32 | is( $response->content_type, 'text/html', 'Response Content-Type' ); |
d1cbffb4 |
33 | is( $response->header('X-Catalyst-Action'), |
34 | 'engine/response/errors/two', 'Test Action' ); |
35 | like( |
36 | $response->header('X-Catalyst-Error'), |
37 | qr/^Couldn't forward to/, |
38 | 'Catalyst Error' |
39 | ); |
dd4e6fd2 |
40 | } |
41 | |
42 | { |
d1cbffb4 |
43 | ok( my $response = request('http://localhost/engine/response/errors/three'), |
44 | 'Request' ); |
dd4e6fd2 |
45 | ok( $response->is_error, 'Response Server Error 5xx' ); |
d1cbffb4 |
46 | is( $response->code, 500, 'Response Code' ); |
dd4e6fd2 |
47 | is( $response->content_type, 'text/html', 'Response Content-Type' ); |
d1cbffb4 |
48 | is( |
49 | $response->header('X-Catalyst-Action'), |
50 | 'engine/response/errors/three', |
51 | 'Test Action' |
52 | ); |
53 | like( |
54 | $response->header('X-Catalyst-Error'), |
49940140 |
55 | qr/I'm going to die!/, |
d1cbffb4 |
56 | 'Catalyst Error' |
57 | ); |
dd4e6fd2 |
58 | } |