Fixed some typos
[catagits/Catalyst-Runtime.git] / t / live / 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
d8c66af5 9use Test::More tests => 240;
dd4e6fd2 10use Catalyst::Test 'TestApp';
11
d8c66af5 12for ( 1 .. 10 ) {
13 {
14 ok( my $response = request('http://localhost/action/local/one'),
15 'Request' );
16 ok( $response->is_success, 'Response Successful 2xx' );
17 is( $response->content_type, 'text/plain', 'Response Content-Type' );
18 is( $response->header('X-Catalyst-Action'),
19 'action/local/one', 'Test Action' );
20 is(
21 $response->header('X-Test-Class'),
22 'TestApp::Controller::Action::Local',
23 'Test Class'
24 );
25 like(
26 $response->content,
27 qr/^bless\( .* 'Catalyst::Request' \)$/s,
28 'Content is a serialized Catalyst::Request'
29 );
30 }
dd4e6fd2 31
d8c66af5 32 {
33 ok( my $response = request('http://localhost/action/local/two'),
34 'Request' );
35 ok( $response->is_success, 'Response Successful 2xx' );
36 is( $response->content_type, 'text/plain', 'Response Content-Type' );
37 is( $response->header('X-Catalyst-Action'),
38 'action/local/two', 'Test Action' );
39 is(
40 $response->header('X-Test-Class'),
41 'TestApp::Controller::Action::Local',
42 'Test Class'
43 );
44 like(
45 $response->content,
46 qr/^bless\( .* 'Catalyst::Request' \)$/s,
47 'Content is a serialized Catalyst::Request'
48 );
49 }
dd4e6fd2 50
d8c66af5 51 {
52 ok( my $response = request('http://localhost/action/local/three'),
53 'Request' );
54 ok( $response->is_success, 'Response Successful 2xx' );
55 is( $response->content_type, 'text/plain', 'Response Content-Type' );
56 is( $response->header('X-Catalyst-Action'),
57 'action/local/three', 'Test Action' );
58 is(
59 $response->header('X-Test-Class'),
60 'TestApp::Controller::Action::Local',
61 'Test Class'
62 );
63 like(
64 $response->content,
65 qr/^bless\( .* 'Catalyst::Request' \)$/s,
66 'Content is a serialized Catalyst::Request'
67 );
68 }
dd4e6fd2 69
d8c66af5 70 {
71 ok(
72 my $response =
73 request('http://localhost/action/local/four/five/six'),
74 'Request'
75 );
76 ok( $response->is_success, 'Response Successful 2xx' );
77 is( $response->content_type, 'text/plain', 'Response Content-Type' );
78 is( $response->header('X-Catalyst-Action'),
79 'action/local/four/five/six', 'Test Action' );
80 is(
81 $response->header('X-Test-Class'),
82 'TestApp::Controller::Action::Local',
83 'Test Class'
84 );
85 like(
86 $response->content,
87 qr/^bless\( .* 'Catalyst::Request' \)$/s,
88 'Content is a serialized Catalyst::Request'
89 );
90 }
dd4e6fd2 91}