Follow Along as I Stumble on the Path to Learning RoR

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

Comments are closed.