[Seaside-dev] Testing trouble
Ken Treis
ken at miriamtech.com
Sat Jan 12 00:17:09 UTC 2013
Hi Diego,
On Jan 11, 2013, at 1:59 AM, Diego Lont wrote:
> I have a problem in testing my code. I have a user in my session I want to use for logging changes (among other things). By default I can access the user in a WAObject by the following code:
> self session user.
>
> When I now write a test, this code crashes on a doesNotUnderstand on #session.
When writing SUnit tests on Seaside components, I usually override #performTest with something like:
performTest
| context |
context := WARequestContext request: nil response: nil.
context push: session while: [ super performTest ]
... where `session` is an instance variable that gets configured in #setUp. You can also configure the request/response if you need to.
I hope that helps. You might get a better answer on the general Seaside list.
--
Ken Treis
Miriam Technologies, Inc.
More information about the seaside-dev
mailing list