7 use lib "$FindBin::Bin/../../../lib";
9 use Test::More tests => 240;
10 use Catalyst::Test 'TestApp';
14 ok( my $response = request('http://localhost/action/private/one'),
16 ok( $response->is_success, 'Response Successful 2xx' );
17 is( $response->content_type, 'text/plain', 'Response Content-Type' );
19 $response->header('X-Test-Class'),
20 'TestApp::Controller::Action::Private',
23 is( $response->content, 'access denied', 'Access' );
27 ok( my $response = request('http://localhost/action/private/two'),
29 ok( $response->is_success, 'Response Successful 2xx' );
30 is( $response->content_type, 'text/plain', 'Response Content-Type' );
32 $response->header('X-Test-Class'),
33 'TestApp::Controller::Action::Private',
36 is( $response->content, 'access denied', 'Access' );
40 ok( my $response = request('http://localhost/three'), 'Request' );
41 ok( $response->is_error, 'Response Server Error 5xx' );
42 is( $response->content_type, 'text/html', 'Response Content-Type' );
44 $response->header('X-Catalyst-Error'),
45 qr/^Unknown resource "three"/,
51 ok( my $response = request('http://localhost/action/private/four'),
53 ok( $response->is_success, 'Response Successful 2xx' );
54 is( $response->content_type, 'text/plain', 'Response Content-Type' );
56 $response->header('X-Test-Class'),
57 'TestApp::Controller::Action::Private',
60 is( $response->content, 'access denied', 'Access' );
64 ok( my $response = request('http://localhost/action/private/five'),
66 ok( $response->is_success, 'Response Successful 2xx' );
67 is( $response->content_type, 'text/plain', 'Response Content-Type' );
69 $response->header('X-Test-Class'),
70 'TestApp::Controller::Action::Private',
73 is( $response->content, 'access denied', 'Access' );