5 use lib "$FindBin::Bin/../lib";
9 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
11 use Test::More tests => 18*$iters;
12 use Catalyst::Test 'TestApp';
14 if ( $ENV{CAT_BENCHMARK} ) {
16 Benchmark::timethis( $iters, \&run_tests );
26 ok( my $response = request('http://localhost/action_global_one'),
28 ok( $response->is_success, 'Response Successful 2xx' );
29 is( $response->content_type, 'text/plain', 'Response Content-Type' );
30 is( $response->header('X-Catalyst-Action'),
31 'action_global_one', 'Test Action' );
33 $response->header('X-Test-Class'),
34 'TestApp::Controller::Action::Global',
39 qr/^bless\( .* 'Catalyst::Request' \)$/s,
40 'Content is a serialized Catalyst::Request'
45 ok( my $response = request('http://localhost/action_global_two'),
47 ok( $response->is_success, 'Response Successful 2xx' );
48 is( $response->content_type, 'text/plain', 'Response Content-Type' );
49 is( $response->header('X-Catalyst-Action'),
50 'action_global_two', 'Test Action' );
52 $response->header('X-Test-Class'),
53 'TestApp::Controller::Action::Global',
58 qr/^bless\( .* 'Catalyst::Request' \)$/s,
59 'Content is a serialized Catalyst::Request'
64 ok( my $response = request('http://localhost/action_global_three'),
66 ok( $response->is_success, 'Response Successful 2xx' );
67 is( $response->content_type, 'text/plain', 'Response Content-Type' );
68 is( $response->header('X-Catalyst-Action'),
69 'action_global_three', 'Test Action' );
71 $response->header('X-Test-Class'),
72 'TestApp::Controller::Action::Global',
77 qr/^bless\( .* 'Catalyst::Request' \)$/s,
78 'Content is a serialized Catalyst::Request'