diff -urN Test-WWW-Mechanize-Catalyst-0.41.orig/lib/Test/WWW/Mechanize/Catalyst.pm Test-WWW-Mechanize-Catalyst-0.41/lib/Test/WWW/Mechanize/Catalyst.pm
--- Test-WWW-Mechanize-Catalyst-0.41.orig/lib/Test/WWW/Mechanize/Catalyst.pm 2008-03-04 10:35:23.000000000 +0100
+++ Test-WWW-Mechanize-Catalyst-0.41/lib/Test/WWW/Mechanize/Catalyst.pm 2008-03-04 10:51:56.000000000 +0100
@@ -40,6 +40,9 @@
my $response = Test::WWW::Mechanize::Catalyst::Aux::request($request);
$response->header( 'Content-Base', $request->uri );
$response->request($request);
+ if ($request->uri->as_string =~ m{^/}) {
+ $request->uri(URI->new('
http://localhost:80/' . $request->uri->as_string));
+ }
$self->cookie_jar->extract_cookies($response) if $self->cookie_jar;
# fail tests under the Catalyst debug screen
diff -urN Test-WWW-Mechanize-Catalyst-0.41.orig/t/cookies.t Test-WWW-Mechanize-Catalyst-0.41/t/cookies.t
--- Test-WWW-Mechanize-Catalyst-0.41.orig/t/cookies.t 1970-01-01 01:00:00.000000000 +0100
+++ Test-WWW-Mechanize-Catalyst-0.41/t/cookies.t 2008-03-04 10:55:52.000000000 +0100
@@ -0,0 +1,24 @@
+#!perl -T
+use strict;
+use warnings;
+use lib 'lib';
+use Test::More;
+
+eval { use Catalyst::Plugin::Session; };
+
+if ($@) {
+ diag($@);
+ plan skip_all => "Need Catalyst::Plugin::Session to run this test";
+} else {
+ plan tests => 3;
+};
+use lib 't/lib';
+use Test::WWW::Mechanize::Catalyst 'CattySession';
+
+my $m = Test::WWW::Mechanize::Catalyst->new;
+$m->credentials( 'user', 'pass' );
+
+$m->get_ok("/");
+$m->title_is("Root");
+
+is( $m->status, 200 );
diff -urN Test-WWW-Mechanize-Catalyst-0.41.orig/t/lib/CattySession.pm Test-WWW-Mechanize-Catalyst-0.41/t/lib/CattySession.pm
--- Test-WWW-Mechanize-Catalyst-0.41.orig/t/lib/CattySession.pm 1970-01-01 01:00:00.000000000 +0100
+++ Test-WWW-Mechanize-Catalyst-0.41/t/lib/CattySession.pm 2008-03-04 10:50:50.000000000 +0100
@@ -0,0 +1,50 @@
+package CattySession;
+
+use strict;
+
+#use Catalyst;
+use Catalyst qw/-Debug
+ Session
+ Session::State::Cookie
+ Session::Store::Dummy
+/;
+use Cwd;
+use MIME::Base64;
+
+our $VERSION = '0.01';
+
+CattySession->config(
+ name => 'CattySession',
+ root => cwd . '/t/root',
+);
+
+CattySession->setup();
+
+sub auto : Private {
+ my ( $self, $context ) = @_;
+ if ($context->session) {
+ return 1;
+ }
+
+}
+sub default : Private {
+ my ( $self, $context ) = @_;
+ my $html = html( "Root", "This is the root page" );
+ $context->response->content_type("text/html");
+ $context->response->output($html);
+}
+
+sub html {
+ my ( $title, $body ) = @_;
+ return qq{
+<html>
+<head><title>$title</title></head>
+<body>
+$body
+<a href="/hello/">Hello</a>.
+</body></html>
+};
+}
+
+1;
+