[Catalyst] Test::WWW:Mechanize::Catalyst

Kieren Diment kieren at diment.org
Mon Jan 26 20:55:50 GMT 2009


On 27/01/2009, at 12:49 AM, kirk beers wrote:

> 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*
>

My favourite trick with T::WWW::M::C is:

PAGER='lynx -stdin' perl -Ilib t/0x-mytest.t

Then I get to the dubious line in my test file (with the n command in  
the debugger) and I can do:

|p $mech->content

And it all comes up nicely in a web browser for me.

I reckon you might be getting a debug screen here, but I'm not getting  
enough information.

> 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 tag [%
> content %]. Next I have a message.tt which is accessed from my  
> controller
> subroutines by:
>
> $c->stash->{message} = 'Something went wrong!';
> $c->stash->{template} = '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.
>
> *Thanks in advance for any help you might provide!*
>
> *Kirk*
>
>
>
>  *
> _______________________________________________
> 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/




More information about the Catalyst mailing list