Thursday, 21 May 2009

Testing gotchas: nested logins don't work

*sigh* after a couple of hours futile hacking about I finally realised that my controller tests were failing because login_as cannot be nested. ie. if you have a context with a login_as @user1 in the setup... then put a context inside it where you login_as @user2... it won't actually do the second login.

So just move that nested context outside. Simples neh?