Merged 5.49_01 (r1339) from refactored branch to trunk
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / end.t
CommitLineData
dd4e6fd2 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin;
9770ad56 7use lib "$FindBin::Bin/../../../lib";
dd4e6fd2 8
c20bd9d9 9use Test::More tests => 7;
dd4e6fd2 10use Catalyst::Test 'TestApp';
11
12
13{
14 my @expected = qw[
dd4e6fd2 15 TestApp::Controller::Action::End->begin
16 TestApp::Controller::Action::End->default
17 TestApp::View::Dump::Request->process
18 TestApp::Controller::Action::End->end
19 ];
20
21 my $expected = join( ", ", @expected );
22
23 ok( my $response = request('http://localhost/action/end'), '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'), 'default', 'Test Action' );
27 is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::End', 'Test Class' );
28 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );
29 like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
30}