eggman2001
2007-Dec-17 18:59 UTC
Is the session hash available to tests or the rails console?
My guess is that the answer is no because the session hash is available only if you''re storing a cookie, and you can''t store a cookie if you''re using the rails console or using the built-in testing functionality. Can someone confirm that this is correct? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Richard Luther
2007-Dec-17 19:04 UTC
Re: Is the session hash available to tests or the rails console?
In tests: Assuming you have this in your setup method: @request ActionController::TestRequest.new You can access the session hash via @request.session On Dec 17, 10:59 am, eggman2001 <sod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> My guess is that the answer is no because the session hash is > available only if you''re storing a cookie, and you can''t store a > cookie if you''re using the rails console or using the built-in testing > functionality. Can someone confirm that this is correct?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---