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