[Catalyst] writing a test suite for my app

Daniel McBrearty danielmcbrearty at gmail.com
Thu May 18 21:30:07 CEST 2006


how do I stop the test object from following redirects?

my $mech = Test::WWW::Mechanize::Catalyst->new;
$mech->requests_redirectable( [] );

.
.
.

$r = $mech->get($dr.'public/menu');
$l = $r->header('location');
print "RESPONSE :".Dumper($r);
ok( $r->is_redirect, 'redirect if no natlang in session');
ok( $l eq '/public/natlang', "Request: ".Dumper($l));

I can see from the debug output that the redirect is happening, but $mech is
following it before giving me the response to examine.

??

thanks



On 5/15/06, Daniel McBrearty <danielmcbrearty at gmail.com> wrote:
>
> OK. So I guess the conclusion is simply that Catalyst::Test is appending
> to "localhost:3000" with NO traling slash, which is why the slash needs to
> be given at the start of the request.
>
> Thanks again.
>
>
> On 5/15/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
> > Daniel McBrearty wrote:
> >
> > > yes. Hence the question about CATALYST_SERVER , which seems to be at
> > the
> > > bottom of it all, I think.
> >
> > Nope, CATALYST_SERVER is entirely unrelated. That's a shell environment
> > variable you can set to tell your test suite you want it to test a
> > remote copy of the app - allows you to do live testing etc.
> >
> > Cat devs often use it to run the main Cat test suite against Engines in
> > development.
> >
> > _______________________________________________
> > Catalyst mailing list
> > Catalyst at lists.rawmode.org
> > http://lists.rawmode.org/mailman/listinfo/catalyst
> >
>
>
>
> --
> Daniel McBrearty
> email : danielmcbrearty at gmail.com
> www.engoi.com : the multi - language vocab trainer
> BTW : 0873928131
>



-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060518/d82e2656/attachment.htm 


More information about the Catalyst mailing list