new test suit
[catagits/Catalyst-Runtime.git] / t / controller / action / private.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use FindBin;
7 use lib "$FindBin::Bin/../../lib";
8
9 use Test::More no_plan => 1;
10 use Catalyst::Test 'TestApp';
11
12
13 {
14     ok( my $response = request('http://localhost/action/private/one'), 'Request' );
15     ok( $response->is_success, 'Response Successful 2xx' );
16     is( $response->content_type, 'text/plain', 'Response Content-Type' );
17     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
18     is( $response->content, 'access denied', 'Access' );
19 }
20
21 {
22     ok( my $response = request('http://localhost/action/private/two'), 'Request' );
23     ok( $response->is_success, 'Response Successful 2xx' );
24     is( $response->content_type, 'text/plain', 'Response Content-Type' );
25     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
26     is( $response->content, 'access denied', 'Access' );
27 }
28
29 {
30     ok( my $response = request('http://localhost/three'), 'Request' );
31     ok( $response->is_success, 'Response Successful 2xx' );
32     is( $response->content_type, 'text/plain', 'Response Content-Type' );
33     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
34     is( $response->content, 'access denied', 'Access' );
35 }
36
37 {
38     ok( my $response = request('http://localhost/action/private/four'), 'Request' );
39     ok( $response->is_success, 'Response Successful 2xx' );
40     is( $response->content_type, 'text/plain', 'Response Content-Type' );
41     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
42     is( $response->content, 'access denied', 'Access' );
43 }
44
45 {
46     ok( my $response = request('http://localhost/action/private/five'), 'Request' );
47     ok( $response->is_success, 'Response Successful 2xx' );
48     is( $response->content_type, 'text/plain', 'Response Content-Type' );
49     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Private', 'Test Class' );
50     is( $response->content, 'access denied', 'Access' );
51 }