X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Fmultipath.t;fp=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Fmultipath.t;h=2d779684936d468e4153d4f425f4829cf3b58746;hb=749472d6839708f3c04912c0ed39ce6141d4d500;hp=0000000000000000000000000000000000000000;hpb=6ff79ec589c8d68937b8060c4d91bc0b2b7c4b88;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live/component/controller/action/multipath.t b/t/live/component/controller/action/multipath.t new file mode 100644 index 0000000..2d77968 --- /dev/null +++ b/t/live/component/controller/action/multipath.t @@ -0,0 +1,49 @@ +#!perl + +use strict; +use warnings; + +use FindBin; +use lib "$FindBin::Bin/../../../lib"; + +use Test::More tests => 16; +use Catalyst::Test 'TestApp'; + +my $content = q/foo +bar +baz +/; + +# Local +{ + ok( my $response = request('http://localhost/action/multipath/multipath'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); +} + +# Global +{ + ok( my $response = request('http://localhost/multipath'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); +} + +# Path('/multipath1') +{ + ok( my $response = request('http://localhost/multipath1'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); +} + +# Path('multipath2') +{ + ok( my $response = request('http://localhost/action/multipath/multipath2'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->content, $content, 'Content is a stream' ); +}