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