X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Findex.t;fp=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Findex.t;h=0000000000000000000000000000000000000000;hb=66741f94ac93b7ba0989db3556d0e3fe36c1be87;hp=cd4f9b01d5c2c9da7639ee4ba13612de2d12178a;hpb=587b0f5882d4f5e128ae082758da37b065a3efde;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live/component/controller/action/index.t b/t/live/component/controller/action/index.t deleted file mode 100644 index cd4f9b0..0000000 --- a/t/live/component/controller/action/index.t +++ /dev/null @@ -1,100 +0,0 @@ -#!perl - -use strict; -use warnings; - -use FindBin; -use lib "$FindBin::Bin/../../../lib"; - -our $iters; - -BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; } - -use Test::More tests => 20*$iters; -use Catalyst::Test 'TestApp'; - -if ( $ENV{CAT_BENCHMARK} ) { - require Benchmark; - Benchmark::timethis( $iters, \&run_tests ); -} -else { - for ( 1 .. $iters ) { - run_tests(); - } -} - -sub run_tests { - # test root index - { - my @expected = qw[ - TestApp->index - TestApp->end - ]; - - my $expected = join( ", ", @expected ); - ok( my $response = request('http://localhost/'), 'root index' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, 'root index', 'root index ok' ); - - ok( $response = request('http://localhost'), 'root index no slash' ); - is( $response->content, 'root index', 'root index no slash ok' ); - } - - # test first-level controller index - { - my @expected = qw[ - TestApp::Controller::Index->index - TestApp->end - ]; - - my $expected = join( ", ", @expected ); - - ok( my $response = request('http://localhost/index/'), 'first-level controller index' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, 'Index index', 'first-level controller index ok' ); - - ok( $response = request('http://localhost/index'), 'first-level controller index no slash' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, 'Index index', 'first-level controller index no slash ok' ); - } - - # test second-level controller index - { - my @expected = qw[ - TestApp::Controller::Action::Index->begin - TestApp::Controller::Action::Index->index - TestApp->end - ]; - - my $expected = join( ", ", @expected ); - - ok( my $response = request('http://localhost/action/index/'), 'second-level controller index' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, 'Action-Index index', 'second-level controller index ok' ); - - ok( $response = request('http://localhost/action/index'), 'second-level controller index no slash' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, 'Action-Index index', 'second-level controller index no slash ok' ); - } - - # test controller default when index is present - { - my @expected = qw[ - TestApp::Controller::Action::Index->begin - TestApp::Controller::Action::Index->default - TestApp->end - ]; - - my $expected = join( ", ", @expected ); - - ok( my $response = request('http://localhost/action/index/foo'), 'default with index' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, "Error - TestApp::Controller::Action\n", 'default with index ok' ); - } -}