I am trying to test my rails 3.1 app (I'm learning testing as I go) and I and stuck with how I authenticate a user since normally it sets a session but the tests aren't using the browser so session is an undefined method. I am using the new rails 3.1 has_secure password.
How can I correctly set up and test authentication, as well as test parts of the app that require the user to be authenticated?
My set up is as follows:
rspec 2 capybara guard factory_girl
Thank you!