7 use lib "$FindBin::Bin/../../../lib";
\r
11 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
\r
13 use Test::More tests => 18*$iters;
\r
14 use Catalyst::Test 'TestApp';
\r
16 if ( $ENV{CAT_BENCHMARK} ) {
\r
18 Benchmark::timethis( -$iters, \&run_tests );
\r
21 for ( 1 .. $iters ) {
\r
29 TestApp::Controller::Action::Detach->begin
\r
30 TestApp::Controller::Action::Detach->one
\r
31 TestApp::Controller::Action::Detach->two
\r
32 TestApp::View::Dump::Request->process
\r
35 my $expected = join( ", ", @expected );
\r
37 # Test detach to chain of actions.
\r
38 ok( my $response = request('http://localhost/action/detach/one'),
\r
40 ok( $response->is_success, 'Response Successful 2xx' );
\r
41 is( $response->content_type, 'text/plain', 'Response Content-Type' );
\r
42 is( $response->header('X-Catalyst-Action'),
\r
43 'action/detach/one', 'Test Action' );
\r
45 $response->header('X-Test-Class'),
\r
46 'TestApp::Controller::Action::Detach',
\r
49 is( $response->header('X-Catalyst-Executed'),
\r
50 $expected, 'Executed actions' );
\r
55 TestApp::Controller::Action::Detach->begin
\r
56 TestApp::Controller::Action::Detach->path
\r
57 TestApp::Controller::Action::Detach->two
\r
58 TestApp::View::Dump::Request->process
\r
61 my $expected = join( ", ", @expected );
\r
63 # Test detach to chain of actions.
\r
64 ok( my $response = request('http://localhost/action/detach/path'),
\r
66 ok( $response->is_success, 'Response Successful 2xx' );
\r
67 is( $response->content_type, 'text/plain', 'Response Content-Type' );
\r
68 is( $response->header('X-Catalyst-Action'),
\r
69 'action/detach/path', 'Test Action' );
\r
71 $response->header('X-Test-Class'),
\r
72 'TestApp::Controller::Action::Detach',
\r
75 is( $response->header('X-Catalyst-Executed'),
\r
76 $expected, 'Executed actions' );
\r
82 request('http://localhost/action/detach/with_args/old'),
\r
85 ok( $response->is_success, 'Response Successful 2xx' );
\r
86 is( $response->content, 'new' );
\r
91 my $response = request(
\r
92 'http://localhost/action/detach/with_method_and_args/old'),
\r
93 'Request with args and method'
\r
95 ok( $response->is_success, 'Response Successful 2xx' );
\r
96 is( $response->content, 'new' );
\r