Added Andy to thank you section
[catagits/Catalyst-Runtime.git] / t / component / controller / action / local.t
CommitLineData
dd4e6fd2 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin;
9770ad56 7use lib "$FindBin::Bin/../../../lib";
dd4e6fd2 8
9use Test::More no_plan => 1;
10use Catalyst::Test 'TestApp';
11
12
13{
e5d7f18c 14 ok( my $response = request('http://localhost/action/local/one'), 'Request' );
dd4e6fd2 15 ok( $response->is_success, 'Response Successful 2xx' );
16 is( $response->content_type, 'text/plain', 'Response Content-Type' );
e5d7f18c 17 is( $response->header('X-Catalyst-Action'), 'action/local/one', 'Test Action' );
18 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
dd4e6fd2 19 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
20}
21
22{
e5d7f18c 23 ok( my $response = request('http://localhost/action/local/two'), 'Request' );
dd4e6fd2 24 ok( $response->is_success, 'Response Successful 2xx' );
25 is( $response->content_type, 'text/plain', 'Response Content-Type' );
e5d7f18c 26 is( $response->header('X-Catalyst-Action'), 'action/local/two', 'Test Action' );
27 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
dd4e6fd2 28 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
29}
30
31{
e5d7f18c 32 ok( my $response = request('http://localhost/action/local/three'), 'Request' );
dd4e6fd2 33 ok( $response->is_success, 'Response Successful 2xx' );
34 is( $response->content_type, 'text/plain', 'Response Content-Type' );
e5d7f18c 35 is( $response->header('X-Catalyst-Action'), 'action/local/three', 'Test Action' );
36 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
dd4e6fd2 37 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
38}
39
40{
e5d7f18c 41 ok( my $response = request('http://localhost/action/local/four/five/six'), 'Request' );
dd4e6fd2 42 ok( $response->is_success, 'Response Successful 2xx' );
43 is( $response->content_type, 'text/plain', 'Response Content-Type' );
e5d7f18c 44 is( $response->header('X-Catalyst-Action'), 'action/local/four/five/six', 'Test Action' );
45 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', 'Test Class' );
dd4e6fd2 46 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
47}