[Catalyst] writing a test suite for my app
Perrin Harkins
perrin at elem.com
Fri May 19 17:26:47 CEST 2006
On Fri, 2006-05-19 at 16:52 +0200, Daniel McBrearty wrote:
> I think I can see why this is the case - in T:W:M:Catalyst.pm ...:
>
> # check if that was a redirect. These codes based off of
> #
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
> if ( grep { $response->code() == $_ } 301, 302, 307 ) {
>
> # blah ... essentially do the redirect ...
> }
> He doesn't check in the base object to see if redirects are allowed.
What he's doing here is simulating hitting your web application without
actually making any HTTP requests. No offense to Leon, but I think this
is a poor way to test. If there are issues caused by your server's
configuration or other modules loaded, you will never see them. My
suggestion would be to stop using this module and just use
Test::WWW::Mechanize against a running server instead. It may be
slower, but it will be a more accurate test.
- Perrin
More information about the Catalyst
mailing list