Urrr. yeah. Sorry.
> I can't just call authorized? to check its return value, because it relies
> on the value of session[:user], and that's nil until a controller action is
> attempted. (Logging in sets the session variable in the request, not the
> controller.)
As penance for my earlier stupidity, here's a suggestion that might
actually be useful. I assume that access_denied either redirects you
to a login, renders a 403 or renders some other template. Could you
assert that those things have happened instead of expecting
access_denied itself has been called?
Murray
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "mocha-developer" group.
To post to this group, send email to mocha-d...@googlegroups.com
To unsubscribe from this group, send email to mocha-develop...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mocha-developer?hl=en
-~----------~----~----~----~------~----~------~--~---
--
You received this message because you are subscribed to the Google Groups "mocha-developer" group.
To post to this group, send email to mocha-d...@googlegroups.com.
To unsubscribe from this group, send email to mocha-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mocha-developer?hl=en.
It explains how to do what I was trying to do originally, i.e.
redefine access_denied() to invoke render, as it would do when a user
is actually denied access. Then the test can expect() normal behavior
rather than artificial (raised exception).
For future reference :)
Curran