I need to do this: Scenario: Access private area without a session Given I don''t have a session When I access private area Then I should see "You are not logged in" Is there a way to remove the session cookie in "Given I don''t have a session" with capybara? I know I could visit the logout page, but what if I didn''t have this feature yet? -- 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.
Have you tried: session.delete or perhaps: session.destroy -- 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.
Given /I am not logged in/ do session.destroy end It doesn''t work! It seems session can be accessed only from a controller, but I''m not sure. On Dec 14, 3:28 pm, James Byrne <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Have you tried: > > session.delete > > or perhaps: > > session.destroy > > -- > Posted viahttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Leandro wrote in post #968636:> Given /I am not logged in/ do > session.destroy > end > > It doesn''t work!When you say "It doesn''t work!" what error are you getting? Is session defined? If not then do you have sessions turned off in the ApplicationController? Have you established a session to start with? Take a look at this for further help: http://rails.nuvvo.com/lesson/6372-action-controller-session -- 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.
On Tue, Dec 14, 2010 at 4:12 AM, Leandro <leandro.costa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I need to do this: > > Scenario: Access private area without a session > Given I don''t have a session > When I access private area > Then I should see "You are not logged in" > > Is there a way to remove the session cookie in "Given I don''t have a > session" with capybara? > I know I could visit the logout page, but what if I didn''t have this > feature yet? > >Leandro, are you using a Authlogic or Devise to provide the authentication functionality? -Conrad> -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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.
No, I''m using my own authentication logic. On Dec 15, 4:38 pm, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Tue, Dec 14, 2010 at 4:12 AM, Leandro <leandro.co...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I need to do this: > > > Scenario: Access private area without a session > > Given I don''t have a session > > When I access private area > > Then I should see "You are not logged in" > > > Is there a way to remove the session cookie in "Given I don''t have a > > session" with capybara? > > I know I could visit the logout page, but what if I didn''t have this > > feature yet? > > Leandro, are you using a Authlogic or Devise to provide the authentication > functionality? > > -Conrad> -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.