[Catalyst] setting/getting session data from within tests

Matt S Trout dbix-class at trout.me.uk
Mon Jun 5 21:46:33 CEST 2006


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




More information about the Catalyst mailing list