X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_request_uri.t;h=28c8d1a00662301fc29f95526fa0b5ac54865471;hb=4e93cdb6d9403718baff430bc1bdc3245aa5236f;hp=4f60c49b5228b13e00572ac30e608d8d05f7e76b;hpb=ae29b412955743885e80350085167b54b69672da;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_engine_request_uri.t b/t/aggregate/live_engine_request_uri.t index 4f60c49..28c8d1a 100644 --- a/t/aggregate/live_engine_request_uri.t +++ b/t/aggregate/live_engine_request_uri.t @@ -4,7 +4,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; -use Test::More tests => 68; +use Test::More tests => 74; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -14,7 +14,8 @@ my $creq; { ok( my $response = request('http://localhost/engine/request/uri/change_path'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ); + ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ) + or diag("Exception '$@', content " . $response->content); like( $creq->uri, qr{/my/app/lives/here$}, 'URI contains new path' ); } @@ -41,7 +42,7 @@ SKIP: if ( $ENV{CATALYST_SERVER} ) { skip 'Using remote server', 5; } - + local $ENV{HTTPS} = 'on'; ok( my $response = request('https://localhost/engine/request/uri'), 'HTTPS Request' ); ok( $response->is_success, 'Response Successful 2xx' ); @@ -56,7 +57,7 @@ SKIP: a => [ qw/1 2/ ], b => 3, }; - + ok( my $response = request('http://localhost/engine/request/uri?a=1;a=2;b=3'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ); @@ -79,6 +80,8 @@ SKIP: ok( $response->is_success, 'Response Successful 2xx' ); ok( !defined $response->header( 'X-Catalyst-Param-a' ), 'param "a" ok' ); is( $response->header( 'X-Catalyst-Param-b' ), '1', 'param "b" ok' ); + is( $response->header( 'X-Catalyst-Param-c' ), '--notexists--', 'param "c" ok' ); + unlike($response->header ('X-Catalyst-query'), qr/c=/, 'no c in return'); } # test that uri_with adds params (and preserves) @@ -87,14 +90,18 @@ SKIP: ok( $response->is_success, 'Response Successful 2xx' ); is( $response->header( 'X-Catalyst-Param-a' ), '1', 'param "a" ok' ); is( $response->header( 'X-Catalyst-Param-b' ), '1', 'param "b" ok' ); + is( $response->header( 'X-Catalyst-Param-c' ), '--notexists--', 'param "c" ok' ); + unlike($response->header ('X-Catalyst-query'), qr/c=/, 'no c in return'); } # test that uri_with replaces params (and preserves) { - ok( my $response = request('http://localhost/engine/request/uri/uri_with?a=1&b=2'), 'Request' ); + ok( my $response = request('http://localhost/engine/request/uri/uri_with?a=1&b=2&c=3'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->header( 'X-Catalyst-Param-a' ), '1', 'param "a" ok' ); is( $response->header( 'X-Catalyst-Param-b' ), '1', 'param "b" ok' ); + is( $response->header( 'X-Catalyst-Param-c' ), '--notexists--', 'param "c" deleted ok' ); + unlike($response->header ('X-Catalyst-query'), qr/c=/, 'no c in return'); } # test that uri_with replaces params (and preserves) @@ -161,7 +168,7 @@ SKIP: if ( $ENV{CATALYST_SERVER} ) { skip 'Using remote server', 2; } - + require TestApp::RequestBaseBug; TestApp->request_class('TestApp::RequestBaseBug'); ok( my $response = request('http://localhost/engine/request/uri'), 'Request' );