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 );
27 TestApp::Controller::Action::Detach->begin
28 TestApp::Controller::Action::Detach->one
29 TestApp::Controller::Action::Detach->two
30 TestApp::View::Dump::Request->process
31 TestApp::Controller::Root->end
34 my $expected = join( ", ", @expected );
36 # Test detach to chain of actions.
37 ok( my $response = request('http://localhost/action/detach/one'),
39 ok( $response->is_success, 'Response Successful 2xx' );
40 is( $response->content_type, 'text/plain', 'Response Content-Type' );
41 is( $response->header('X-Catalyst-Action'),
42 'action/detach/one', 'Test Action' );
44 $response->header('X-Test-Class'),
45 'TestApp::Controller::Action::Detach',
48 is( $response->header('X-Catalyst-Executed'),
49 $expected, 'Executed actions' );
54 TestApp::Controller::Action::Detach->begin
55 TestApp::Controller::Action::Detach->path
56 TestApp::Controller::Action::Detach->two
57 TestApp::View::Dump::Request->process
58 TestApp::Controller::Root->end
61 my $expected = join( ", ", @expected );
63 # Test detach to chain of actions.
64 ok( my $response = request('http://localhost/action/detach/path'),
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/detach/path', 'Test Action' );
71 $response->header('X-Test-Class'),
72 'TestApp::Controller::Action::Detach',
75 is( $response->header('X-Catalyst-Executed'),
76 $expected, 'Executed actions' );
82 request('http://localhost/action/detach/with_args/old'),
85 ok( $response->is_success, 'Response Successful 2xx' );
86 is( $response->content, 'new' );
91 my $response = request(
92 'http://localhost/action/detach/with_method_and_args/old'),
93 'Request with args and method'
95 ok( $response->is_success, 'Response Successful 2xx' );
96 is( $response->content, 'new' );