Added recursive -r flag to prove example
[catagits/Catalyst-Runtime.git] / t / live / component / controller / action / regexp.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 => 12;
10 use Catalyst::Test 'TestApp';
11
12
13 {
14     ok( my $response = request('http://localhost/action/regexp/10/hello'), '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/regexp/(\d+)/(\w+)$', 'Test Action' );
18     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Regexp', '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/regexp/hello/10'), '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/regexp/(\w+)/(\d+)$', 'Test Action' );
27     is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Regexp', 'Test Class' );
28     like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' );
29 }