Commit | Line | Data |
7f23827b |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
b1ead5a2 |
5 | use lib "$FindBin::Bin/../lib"; |
7f23827b |
6 | |
7 | our $iters; |
8 | |
6b25e555 |
9 | BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } |
7f23827b |
10 | |
11 | use Test::More tests => 3*$iters; |
12 | use Catalyst::Test 'TestAppDoubleAutoBug'; |
13 | |
14 | if ( $ENV{CAT_BENCHMARK} ) { |
15 | require Benchmark; |
16 | Benchmark::timethis( $iters, \&run_tests ); |
17 | } |
18 | else { |
19 | for ( 1 .. $iters ) { |
20 | run_tests(); |
21 | } |
22 | } |
737a1e42 |
23 | |
7f23827b |
24 | sub run_tests { |
943ca690 |
25 | SKIP: |
7f23827b |
26 | { |
943ca690 |
27 | if ( $ENV{CATALYST_SERVER} ) { |
28 | skip 'Using remote server', 3; |
29 | } |
737a1e42 |
30 | |
943ca690 |
31 | { |
32 | my @expected = qw[ |
cf013d38 |
33 | TestAppDoubleAutoBug::Controller::Root->auto |
34 | TestAppDoubleAutoBug::Controller::Root->default |
35 | TestAppDoubleAutoBug::Controller::Root->end |
943ca690 |
36 | ]; |
737a1e42 |
37 | |
943ca690 |
38 | my $expected = join( ", ", @expected ); |
737a1e42 |
39 | |
943ca690 |
40 | ok( my $response = request('http://localhost/action/auto/one'), 'auto + local' ); |
41 | is( $response->header('X-Catalyst-Executed'), |
42 | $expected, 'Executed actions' ); |
43 | is( $response->content, 'default, auto=1', 'Content OK' ); |
44 | } |
7f23827b |
45 | } |
46 | } |