[Catalyst] setting/getting session data from within tests

Daniel McBrearty danielmcbrearty at gmail.com
Mon Jun 5 21:51:14 CEST 2006


ahah! thanks!

On 6/5/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
> Daniel McBrearty wrote:
> > 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.
>
> Don't even need that. Notice *t/lib* not just lib in my example.
>
> >> 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
> >>
> >
> >
>
>
> _______________________________________________
> 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