I recently upgraded to Rails 2.3.8 from 2.1.0 (not sure if that has
anything to do with it though), and my integration tests are no longer
able to do anything requiring the user to be logged in. The tests can
log in successfully, but when another request is made, the user is no
longer recognized as logged in.
When I inspect the session just after logging in, I see this:
{:user_id=>4,
"flash"=>{:notice=>"Logged in successfully"},
:session_id=>"76df7358fb3dd5f5ff97f15e4a3c652a"}
When I do another request, eg get "/home", the session contains only
this:
{:return_to=>"/home",
:session_id=>"76df7358fb3dd5f5ff97f15e4a3c652a"}
This problem only exists within the tests... when I manually visit the
site, everything works perfectly. I have upgraded restful_authentication
plugin, I have gone through the whole process with the debugger, I have
tried everything I can think of to find the problem, but I''m totally
stumped. What could be causing this?
Thanks!
Jack
--
Posted via http://www.ruby-forum.com/.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Sep-09 21:27 UTC
Re: Integration tests failing with restful_authentication
Jack Senechal wrote:> I recently upgraded to Rails 2.3.8 from 2.1.0 (not sure if that has > anything to do with it though), and my integration tests are no longer > able to do anything requiring the user to be logged in.[...]> I have upgraded restful_authentication > plugin, I have gone through the whole process with the debugger, I have > tried everything I can think of to find the problem, but I''m totally > stumped. What could be causing this?I''m not absolutely sure, but IMHO you should give some serious thought to removing both restful_authentication and integration tests. restful_authentication is (as you''ve discovered) hard to test, due in part to relying on unmaintainable generated code thrown right into your User model. I recommend replacing it with Authlogic, which is better designed, more modular, and easier to test. Likewise, Cucumber can (and should) take the place of integration tests; you''ll have fewer headaches.> > Thanks! > JackBest, -- Marnen Laibow-koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.