Figured out my own answer here. Solution was to add
fixtures :users
at the top of the controller spec, and then
login_as :username
in the before(:each) block of each description
..... duh .....
On Oct 1, 11:10 am, Neal L
<neal.lo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi all,
>
> I''m starting to use the restful_authenticaiton plugin in a
project,
> and am using Rspec to write tests. The problem I''m having is that
> most of the app has requires that the user be logged in -- i.e.,:
>
> before_filter :login_required
>
> The problem I''m running into with my Rspec tests is that I
can''t quite
> figure out how to get the user logged in. I''ve read a few blog
posts
> on this, but I can''t get my hands on some working test code. Has
> anyone out there run into this?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---