Added recursive -r flag to prove example
[catagits/Catalyst-Runtime.git] / t / component / controller / action / begin.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=>7;
10 use Catalyst::Test 'TestApp';
11
12
13 {
14     my @expected = qw[
15         TestApp::Controller::Action::Begin->begin
16         TestApp::Controller::Action::Begin->default
17         TestApp::View::Dump::Request->process
18     ];
19
20     my $expected = join( ", ", @expected );
21
22     ok( my $response = request('http://localhost/action/begin'), 'Request' );
23     ok( $response->is_success, 'Response Successful 2xx' );
24     is( $response->content_type, 'text/plain', 'Response Content-Type' );
25     is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
26     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Begin', 'Test Class' );
27     is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
28     like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
29 }