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=738e4224bc5e6febbb1493c9d827b24b33dedbfd;hb=e0e47c71fdefb2f22ce618560c6546bade22ea53;hp=0000000000000000000000000000000000000000;hpb=78ddf097b5d1c38524df46e8541a0bb319dc2d41;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live/component/controller/action/index.t b/t/live/component/controller/action/index.t new file mode 100644 index 0000000..738e422 --- /dev/null +++ b/t/live/component/controller/action/index.t @@ -0,0 +1,36 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../../../lib"; + +use Test::More tests => 10; +use Catalyst::Test 'TestApp'; + +for ( 1 .. 1 ) { + # test root index + { + ok( my $response = request('http://localhost/'), 'root index' ); + 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 controller index + { + ok( my $response = request('http://localhost/action/index/'), 'controller index' ); + is( $response->content, 'Action::Index index', 'controller index ok' ); + + ok( $response = request('http://localhost/action/index'), 'controller index no slash' ); + is( $response->content, 'Action::Index index', 'controller index no slash ok' ); + } + + # test controller default when index is present + { + ok( my $response = request('http://localhost/action/index/foo'), 'default with index' ); + is( $response->content, "Error - TestApp::Controller::Action\n", 'default with index ok' ); + } +}