25 September 2007
This post may be outdated due to it was written on 2007. The links may be broken. The code may be not working anymore. Leave comments if needed.
one is using Test::WWW::Mechanize::Catalyst. as recommended in Catalyst::Manual::Tutorial::Testing.

the other way is using MyApp to get $c. like here:
http://lists.scsys.co.uk/pipermail/catalyst/2007-April/012926.html

my $controller = MyApp->controller('MyController');
my $c = MyApp->prepare();

# Monkey with $c to set up a fake context (set req->uri, or params)

my $result = $controller->method_to_test($c, @args);


Enjoy!


blog comments powered by Disqus