Added recursive -r flag to prove example
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / global.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 tests => 18;
10 use Catalyst::Test 'TestApp';
11
12
13 {
14     ok( my $response = request('http://localhost/action_global_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-Catalyst-Action'), 'action_global_one', 'Test Action' );
18     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
19     like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
20 }
21
22 {
23     ok( my $response = request('http://localhost/action_global_two'), 'Request' );
24     ok( $response->is_success, 'Response Successful 2xx' );
25     is( $response->content_type, 'text/plain', 'Response Content-Type' );
26     is( $response->header('X-Catalyst-Action'), 'action_global_two', 'Test Action' );
27     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
28     like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
29 }
30
31 {
32     ok( my $response = request('http://localhost/action_global_three'), 'Request' );
33     ok( $response->is_success, 'Response Successful 2xx' );
34     is( $response->content_type, 'text/plain', 'Response Content-Type' );
35     is( $response->header('X-Catalyst-Action'), 'action_global_three', 'Test Action' );
36     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' );
37     like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
38 }