7 use lib "$FindBin::Bin/../lib";
11 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
13 use Test::More tests => 18*$iters;
14 use Catalyst::Test 'TestApp';
16 if ( $ENV{CAT_BENCHMARK} ) {
18 Benchmark::timethis( $iters, \&run_tests );
29 TestApp::Controller::Action::Detach->begin
30 TestApp::Controller::Action::Detach->one
31 TestApp::Controller::Action::Detach->two
32 TestApp::View::Dump::Request->process
33 TestApp::Controller::Root->end
36 my $expected = join( ", ", @expected );
38 # Test detach to chain of actions.
39 ok( my $response = request('http://localhost/action/detach/one'),
41 ok( $response->is_success, 'Response Successful 2xx' );
42 is( $response->content_type, 'text/plain', 'Response Content-Type' );
43 is( $response->header('X-Catalyst-Action'),
44 'action/detach/one', 'Test Action' );
46 $response->header('X-Test-Class'),
47 'TestApp::Controller::Action::Detach',
50 is( $response->header('X-Catalyst-Executed'),
51 $expected, 'Executed actions' );
56 TestApp::Controller::Action::Detach->begin
57 TestApp::Controller::Action::Detach->path
58 TestApp::Controller::Action::Detach->two
59 TestApp::View::Dump::Request->process
60 TestApp::Controller::Root->end
63 my $expected = join( ", ", @expected );
65 # Test detach to chain of actions.
66 ok( my $response = request('http://localhost/action/detach/path'),
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/detach/path', 'Test Action' );
73 $response->header('X-Test-Class'),
74 'TestApp::Controller::Action::Detach',
77 is( $response->header('X-Catalyst-Executed'),
78 $expected, 'Executed actions' );
84 request('http://localhost/action/detach/with_args/old'),
87 ok( $response->is_success, 'Response Successful 2xx' );
88 is( $response->content, 'new' );
93 my $response = request(
94 'http://localhost/action/detach/with_method_and_args/old'),
95 'Request with args and method'
97 ok( $response->is_success, 'Response Successful 2xx' );
98 is( $response->content, 'new' );