Why not try the famous restful_authentication plugin? Then in your test_helper.rb add this line:
include AuthenticatedTestSystem Now you'll have a login_as method, which will do what you need. -- James Chen http://ashchan.com On Sep 18, 3:45 pm, ct9a <[email protected]> wrote: > hi all, > > I googled a bit and tried looking up several rails books to no > success. > > I have a users.yml file which contains two users: one with admin > priviledges and one without > > My application_controller.rb has a method which checks if a given > user has admin priviledges or not. > > I have 3 controllers: Users, UserSessions and Post. > I am using Authlogic. > > For my Post functional tests, I would like to know how do I log each > user fixture in and test as accordingly (ie some parts of the site > should not be accessible by non-admin users). > > Thank you. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

