X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flive_catalyst_test.t;h=2589ae5f997d9bc96d9f1e4ba95d873ff8a94bf9;hp=f4f695ed4e7f08212668bfd78e3f8c4a1583e7db;hb=53c7cc10e26c965f7502936609c5d1e6a35dc819;hpb=d9d04deddc21923005721f9f86298b068c656369 diff --git a/t/live_catalyst_test.t b/t/live_catalyst_test.t index f4f695e..2589ae5 100644 --- a/t/live_catalyst_test.t +++ b/t/live_catalyst_test.t @@ -1,16 +1,30 @@ +use strict; +use warnings; + use FindBin; use lib "$FindBin::Bin/lib"; use Catalyst::Test 'TestApp', {default_host => 'default.com'}; use Catalyst::Request; +use HTTP::Request::Common; -use Test::More tests => 8; +use Test::More; content_like('/',qr/root/,'content check'); action_ok('/','Action ok ok','normal action ok'); action_redirect('/engine/response/redirect/one','redirect check'); action_notfound('/engine/response/status/s404','notfound check'); + +# so we can see the default test name +action_ok('/'); + contenttype_is('/action/local/one','text/plain','Contenttype check'); +### local_request() was not setting response base from base href +{ + my $response = request('/base_href_test'); + is( $response->base, 'http://www.example.com/', 'response base set from base href'); +} + my $creq; my $req = '/dump/request'; @@ -30,3 +44,16 @@ my $req = '/dump/request'; eval '$creq = ' . request($req, \%opts)->content; is( $creq->uri->host, $opts{host}, 'target host is mutable via options hashref' ); } + +{ + my $response = request( POST( '/bodyparams', { override => 'this' } ) )->content; + is($response, 'that', 'body param overridden'); +} + +{ + my $response = request( POST( '/bodyparams/no_params' ) )->content; + is($response, 'HASH', 'empty body param is hashref'); +} + +done_testing; +