Remove testsuite's assumptions about where it's mounted on a web server
Florian Ragwitz [Wed, 2 Mar 2011 13:11:05 +0000 (14:11 +0100)]
t/aggregate/live_component_controller_action_forward.t
t/aggregate/live_component_controller_action_regexp.t
t/lib/TestApp/Controller/Action/ForwardTo.pm

index 3d838b8..d968965 100644 (file)
@@ -242,7 +242,7 @@ sub run_tests {
             'forward_to_uri_check request');
 
         ok( $response->is_success, 'forward_to_uri_check successful');
-        is( $response->content, '/action/forward/foo/bar',
+        is( $response->content, 'action/forward/foo/bar',
              'forward_to_uri_check correct namespace');
     }
 
index 36a679e..fd65665 100644 (file)
@@ -131,11 +131,9 @@ sub run_tests {
             'TestApp::Controller::Action::Regexp',
             'Test Class'
         );
-        my $location = $response->header('location');
-        $location =~ s/localhost(:\d+)?/localhost/;
         is(
-            $location,
-            $url,
+            $response->header('location'),
+            $response->request->uri,
             'Redirect URI is the same as the request URI'
         );
     }
index 92db7f2..37a7055 100644 (file)
@@ -5,7 +5,7 @@ use base 'TestApp::Controller::Action';
 
 sub uri_check : Private {
     my ( $self, $c ) = @_;
-    $c->res->body( $c->uri_for('foo/bar')->path );
+    $c->res->body( $c->uri_for('foo/bar')->rel($c->req->base)->path );
 }
 
 1;