[Catalyst-commits] r8753 - Catalyst-Runtime/5.80/trunk/t/aggregate
andyg at dev.catalyst.perl.org
andyg at dev.catalyst.perl.org
Fri Dec 5 17:36:49 GMT 2008
Author: andyg
Date: 2008-12-05 17:36:48 +0000 (Fri, 05 Dec 2008)
New Revision: 8753
Modified:
Catalyst-Runtime/5.80/trunk/t/aggregate/live_engine_request_uri.t
Log:
Fix engine_request_uri tests to work on remote server with different URI
Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_engine_request_uri.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_engine_request_uri.t 2008-12-05 17:25:29 UTC (rev 8752)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_engine_request_uri.t 2008-12-05 17:36:48 UTC (rev 8753)
@@ -121,27 +121,31 @@
# 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' );
More information about the Catalyst-commits
mailing list