When writing functional (e.g. controller unit) tests, I'm running into a simple problem that I'm sure is very easy to fix, but I'm not sure of the correct approach.
If I request a resource in my test case, via something like "get :get_template" (where :get_template is an action on my controller), I get a 302 and when I inspect the response, I see that it is redirecting me to the login page (which makes sense since the :get_template action is protected by authentication).
How do I handle the login requirement in my functional test? I use acts_as_authenticated, which mandates an AccountController to manage login, so by definition, I need to do something (meet the login requirements) in another controller (Account) than the one I am testing. Does that imply that I'm immediately in integration test territory?
Is there a simple way to manage it in the functional test? I considered monkey patching the controller to skip the check_authorization before_filter so that the test requests won't be redirected, but that seems like it's overkill.
Thanks, Wes