Logging in a User with Authlogic

In order to test secure pages, you’ll need to login.  If you use Authlogic, here is the link to how to use its test helpers (Devise also has test helpers):

http://rdoc.info/github/binarylogic/authlogic/master/Authlogic/TestCase

to login a user, I did this:

session = UserSession.create(@user)

and to log the user out, I did this:

session.destroy

Advertisements