On Mon, Dec 14, 2009 at 1:05 AM, Amit Kulkarni <li...@ruby-forum.com> wrote: > Thanks David, > Now in spec when i write login_as :admin then there must be some method > written for login_as?
That would be a helper that you write yourself or is provided by the authentication framework you're using. It lives in the spec suite, not in the controller code, and does whatever is necessary to either actually log in. The most black box approach is to post to the controller that manages logging in. What it looks like depends on how you design your authentication system. restful_authentication, for example, ships with login_as and authorize_as methods that set session variables directly. HTH, David _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users