X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_engine_request_uri.t;h=4f60c49b5228b13e00572ac30e608d8d05f7e76b;hb=1cda0e2cc52505b63b7ac8e141ba4a43917d2e14;hp=e3b4fb7b3d8fd6906bc81a7d2c13b43e23df1d0a;hpb=f7c7f289f3e21a8958afb12d1691c6be8d41ce45;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_engine_request_uri.t b/t/aggregate/live_engine_request_uri.t index e3b4fb7..4f60c49 100644 --- a/t/aggregate/live_engine_request_uri.t +++ b/t/aggregate/live_engine_request_uri.t @@ -121,27 +121,31 @@ SKIP: # more tests with undef - should be ignored { my $uri = "http://localhost/engine/request/uri/uri_with_undef_only"; + my ($check) = $uri =~ m{^http://localhost(.+)}; # needed to work with remote servers ok( my $response = request($uri), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->header( 'X-Catalyst-uri-with' ), $uri, 'uri_with ok' ); + like( $response->header( 'X-Catalyst-uri-with' ), qr/$check$/, 'uri_with ok' ); # try with existing param $uri = "$uri?x=1"; + ($check) = $uri =~ m{^http://localhost(.+)}; # needed to work with remote servers + $check =~ s/\?/\\\?/g; ok( $response = request($uri), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->header( 'X-Catalyst-uri-with' ), $uri, 'uri_with ok' ); + like( $response->header( 'X-Catalyst-uri-with' ), qr/$check$/, 'uri_with ok' ); } { my $uri = "http://localhost/engine/request/uri/uri_with_undef_ignore"; + my ($check) = $uri =~ m{^http://localhost(.+)}; # needed to work with remote servers ok( my $response = request($uri), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->header( 'X-Catalyst-uri-with' ), "${uri}?a=1", 'uri_with ok' ); + like( $response->header( 'X-Catalyst-uri-with' ), qr/$check\?a=1/, 'uri_with ok' ); # remove an existing param ok( $response = request("${uri}?b=1"), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->header( 'X-Catalyst-uri-with' ), "${uri}?a=1", 'uri_with ok' ); + like( $response->header( 'X-Catalyst-uri-with' ), qr/$check\?a=1/, 'uri_with ok' ); # remove an existing param, leave one, and add a new one ok( $response = request("${uri}?b=1&c=1"), 'Request' );