[Catalyst] setting/getting session data from within tests

Daniel McBrearty danielmcbrearty at gmail.com
Mon Jun 5 21:13:09 CEST 2006


I thought about that too. Also could have a method to set session data
via soem cgi params.

I got a bit stuck wondering how to make those params unavailable in
the production cod though. But it's probably not that bad - just use a
config variable so it only works in dev/test modes.

>
> Why bother?
>
> t/lib/MyApp/Controller/Test.pm
>
> sub dump_stuff :Local {
>    <lob contents of session etc. into $c->res->body here>
> }
>
> in your test
>
> use lib qw(t/lib);
>
> then get the data via a mech request to /test/dump_stuff ...
>
> _______________________________________________
> 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



More information about the Catalyst mailing list