improved docs showing how to handle redirects
Kieren Diment [Mon, 12 Mar 2007 11:07:02 +0000 (11:07 +0000)]
lib/Catalyst/Test.pm

index ee37228..b3c25cc 100644 (file)
@@ -55,6 +55,17 @@ Returns the content.
 
     my $content = get('foo/bar?test=1');
 
+Note that this method doesn't follow redirects, so to test for a
+correctly redirecting page you'll need to use a combination of this
+method and the L<request> method below:
+
+    my $res = request('/'); # redirects to /y
+    warn $res->header('location');
+    use URI;
+    my $uri = URI->new($res->header('location'));
+    is ( $uri->path , '/y');
+    my $content = get($uri->path);
+
 =head2 request
 
 Returns a C<HTTP::Response> object.