Merged 5.49_01 (r1339) from refactored branch to trunk
[catagits/Catalyst-Runtime.git] / t / live / 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     my @expected = qw[
14       TestApp::Controller::Action::Begin->begin
15       TestApp::Controller::Action::Begin->default
16       TestApp::View::Dump::Request->process
17     ];
18
19     my $expected = join( ", ", @expected );
20
21     ok( my $response = request('http://localhost/action/begin'), 'Request' );
22     ok( $response->is_success, 'Response Successful 2xx' );
23     is( $response->content_type, 'text/plain', 'Response Content-Type' );
24     is( $response->header('X-Catalyst-Action'), 'default', 'Test Action' );
25     is(
26         $response->header('X-Test-Class'),
27         'TestApp::Controller::Action::Begin',
28         'Test Class'
29     );
30     is( $response->header('X-Catalyst-Executed'),
31         $expected, 'Executed actions' );
32     like( $response->content, qr/'Catalyst::Request'/,
33         'Content is a serialized Catalyst::Request' );
34 }