7 use lib "$FindBin::Bin/lib";
11 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
13 use Test::More tests => 9*$iters;
14 use Catalyst::Test 'TestApp';
16 if ( $ENV{CAT_BENCHMARK} ) {
18 Benchmark::timethis( $iters, \&run_tests );
29 TestApp::Controller::Action::ChildOf->begin
30 TestApp::Controller::Action::ChildOf->foo
31 TestApp::Controller::Action::ChildOf->endpoint
32 TestApp::Controller::Action::ChildOf->end
35 my $expected = join( ", ", @expected );
37 ok( my $response = request('http://localhost/childof/foo/1/end/2'), 'childof + local endpoint' );
38 is( $response->header('X-Catalyst-Executed'),
39 $expected, 'Executed actions' );
40 is( $response->content, '1; 2', 'Content OK' );
44 TestApp::Controller::Action::ChildOf->begin
45 TestApp::Controller::Action::ChildOf->foo
46 TestApp::Controller::Action::ChildOf::Foo->spoon
47 TestApp::Controller::Action::ChildOf->end
50 my $expected = join( ", ", @expected );
52 ok( my $response = request('http://localhost/childof/foo/1/spoon'), 'childof + subcontroller endpoint' );
53 is( $response->header('X-Catalyst-Executed'),
54 $expected, 'Executed actions' );
55 is( $response->content, '1; ', 'Content OK' );
59 TestApp::Controller::Action::ChildOf->begin
60 TestApp::Controller::Action::ChildOf->bar
61 TestApp::Controller::Action::ChildOf->finale
62 TestApp::Controller::Action::ChildOf->end
65 my $expected = join( ", ", @expected );
67 ok( my $response = request('http://localhost/childof/bar/1/spoon'), 'childof + relative endpoint' );
68 is( $response->header('X-Catalyst-Executed'),
69 $expected, 'Executed actions' );
70 is( $response->content, '; 1, spoon', 'Content OK' );