[rspec-users] Mocking Authentication

Graeme Nelson graeme.nelson at planetargon.com
Thu Apr 5 22:07:01 EDT 2007


Hi Michael -

Here is how I am doing it on a current project.

   def mock_user_authentication(allow_user_to_pass=true)
     controller.stub!(:login_required).and_return(allow_user_to_pass)
   end

The controller is available in your controller specs.

Thanks
Graeme Nelson


On Apr 5, 2007, at 6:30 PM, Michael Trier wrote:

> Is anyone using Restful Authentication?  If so, how are you mocking
> the login for your controllers?  I'm having trouble with it and would
> love an example of someone's login.  I'm sure I'm missing something
> simple.
>
> Michael
> railsconsulting.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



--
Graeme Nelson
Developer

PLANET ARGON, LLC
Ruby on Rails Development, Consulting & Hosting

www.planetargon.com

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070405/3dc5c751/attachment-0001.html 


More information about the rspec-users mailing list