[Catalyst] Test::WWW:Mechanize::Catalyst
kirk beers
kgbjed at gmail.com
Tue Feb 3 02:26:30 GMT 2009
You were exactly correct Will. Thanks for putting me onto $mech->content. I
was able to find out that my sign-in and authorization wasn't working
properly because I had incorrect config info for my ACL class.
Thanks again!!
On Mon, Jan 26, 2009 at 10:20 AM, Will Hawes <wdhawes at gmail.com> wrote:
> 2009/1/26 kirk beers <kgbjed at gmail.com>:
> > Hi folks,
> >
> > I am fairly new to Catalyst and Perl (conformed Java programmer), I was
> > wondering if anyone could help me with and issue with
> > WWW::Mechanize::Catalyst::Test
> >
> > specifically :
> > $mech->content_contains($str,[,$desc]);
> >
> > I have added a wrapper.tt and set it in my view/HTML.pm. This wrapper
> > contains access to my common files .css and images with the following t=
ag
> [%
> > content %]. Next I have a message.tt which is accessed from my
> controller
> > subroutines by:
> >
> > $c->stash->{message} =3D 'Something went wrong!';
> > $c->stash->{template} =3D 'message.tt';
> >
> > When I use the $mech->content_contains('There was missing info or the
> > passwords did not match!','Test for missing username to add user');
> >
> > I get the following error stating it can't find the message text.
> >
> > not ok 12 - Test for missing username to add user
> >
> > # Failed test 'Test for missing username to add user'
> > # at t/controller_Admin-User.t line 25.
> > # searched: "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric"...
> > # can't find: "There was missing info or the passwords did not ma"...
> > 1..12
> > # Looks like you failed 1 test of 12.
>
> That means the string you are searching for isn't present in the
> response body. I suspect you're either getting something different
> back than you expected (e.g. an error page) or the string you have
> supplied in the test doesn't match exactly with the error you're
> generating in the HTML (e.g. a typo).
>
> Dumping out the results of $mech->content to see what exactly output
> you produced should pinpoint the problem.
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090202/faae2=
4e2/attachment.htm
More information about the Catalyst
mailing list