7 use lib "$FindBin::Bin/../../../lib";
11 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
13 use Test::More tests => 24*$iters;
14 use Catalyst::Test 'TestApp';
16 if ( $ENV{CAT_BENCHMARK} ) {
18 Benchmark::timethis( -$iters, \&run_tests );
28 ok( my $response = request('http://localhost/action/local/one'),
30 ok( $response->is_success, 'Response Successful 2xx' );
31 is( $response->content_type, 'text/plain', 'Response Content-Type' );
32 is( $response->header('X-Catalyst-Action'),
33 'action/local/one', 'Test Action' );
35 $response->header('X-Test-Class'),
36 'TestApp::Controller::Action::Local',
41 qr/^bless\( .* 'Catalyst::Request' \)$/s,
42 'Content is a serialized Catalyst::Request'
47 ok( my $response = request('http://localhost/action/local/two'),
49 ok( $response->is_success, 'Response Successful 2xx' );
50 is( $response->content_type, 'text/plain', 'Response Content-Type' );
51 is( $response->header('X-Catalyst-Action'),
52 'action/local/two', 'Test Action' );
54 $response->header('X-Test-Class'),
55 'TestApp::Controller::Action::Local',
60 qr/^bless\( .* 'Catalyst::Request' \)$/s,
61 'Content is a serialized Catalyst::Request'
66 ok( my $response = request('http://localhost/action/local/three'),
68 ok( $response->is_success, 'Response Successful 2xx' );
69 is( $response->content_type, 'text/plain', 'Response Content-Type' );
70 is( $response->header('X-Catalyst-Action'),
71 'action/local/three', 'Test Action' );
73 $response->header('X-Test-Class'),
74 'TestApp::Controller::Action::Local',
79 qr/^bless\( .* 'Catalyst::Request' \)$/s,
80 'Content is a serialized Catalyst::Request'
87 request('http://localhost/action/local/four/five/six'),
90 ok( $response->is_success, 'Response Successful 2xx' );
91 is( $response->content_type, 'text/plain', 'Response Content-Type' );
92 is( $response->header('X-Catalyst-Action'),
93 'action/local/four/five/six', 'Test Action' );
95 $response->header('X-Test-Class'),
96 'TestApp::Controller::Action::Local',
101 qr/^bless\( .* 'Catalyst::Request' \)$/s,
102 'Content is a serialized Catalyst::Request'