Re: [rspec-users] step definitons to check login

2009-02-09 Thread Nick Hoffman
On 17/12/2008, at 9:56 AM, James Byrne wrote: Re: authlogin Can someone familiar with this gem explain where and how the user_sessions are maintained? I have pawed through the code but it has left me rather more confused than not. The best inkling I can arrive at is that the authlogic pe

Re: [rspec-users] step definitons to check login

2008-12-17 Thread David Chelimsky
On Wed, Dec 17, 2008 at 9:23 AM, James Byrne wrote: > Pat Maddox wrote: >> James Byrne writes: > >> >> I think Zach's point was that you can tell that someone is logged in if >> you see a "edit your profile" link somewhere, and they're not logged in >> if you see a "log in" link on the page. Yes

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Nicolás Sanguinetti wrote: > > Of course, a 30 second trip in google land would have led you to the > ruby documentation, where you'd have found a good explanation with > examples. Or, running `ri public` would've steered you in the right > direction. > > -foca > > /me wishes people used ri more

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Pat Maddox wrote: > James Byrne writes: > > I think Zach's point was that you can tell that someone is logged in if > you see a "edit your profile" link somewhere, and they're not logged in > if you see a "log in" link on the page. Yes, of course it's useful to > know whether someone is authent

Re: [rspec-users] step definitons to check login

2008-12-17 Thread Nicolás Sanguinetti
Module#public (a private method) works in one of two ways: 1) it receives a list of symbols with method names, those methods are decorated as public. 2) it receives no arguments, in which case all methods defined from that point forward (until another visibility declaration is encountered in the cl

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Re: authlogin Can someone familiar with this gem explain where and how the user_sessions are maintained? I have pawed through the code but it has left me rather more confused than not. The best inkling I can arrive at is that the authlogic persistence token is stored in the session data and

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Andrew Premdas wrote: > Doing this for Restful-Authentication I add the following in > features/support/env.rb > > # Make visible for testing > ApplicationController.send(:public, :logged_in?, :current_user, > :authorized?) > Forgive my ignorance but would you do me the favour of explaining ex

Re: [rspec-users] step definitons to check login

2008-12-17 Thread Pat Maddox
James Byrne writes: > Zach Dennis wrote: >> On Tue, Dec 16, 2008 at 8:30 PM, Zach Dennis >> wrote: >>> >>> I know why you're doing it, but I just want to know *why* you're doing >>> it? Can you not tell through the application itself that someone is >>> logged in, logged out, and verify their i

Re: [rspec-users] step definitons to check login

2008-12-17 Thread James Byrne
Zach Dennis wrote: > On Tue, Dec 16, 2008 at 8:30 PM, Zach Dennis > wrote: >> >> I know why you're doing it, but I just want to know *why* you're doing >> it? Can you not tell through the application itself that someone is >> logged in, logged out, and verify their identity without having to >> e

Re: [rspec-users] step definitons to check login

2008-12-16 Thread Zach Dennis
On Tue, Dec 16, 2008 at 8:30 PM, Zach Dennis wrote: > On Tue, Dec 16, 2008 at 7:48 PM, Andrew Premdas wrote: >> So I can confirm that I'm logged in, that the user is who I say he is, etc. >> >> e.g >> >> Then /^I should be logged in$/ do >> controller.logged_in?.should be_true >> end >> >> make

Re: [rspec-users] step definitons to check login

2008-12-16 Thread aslak hellesoy
On Wed, Dec 17, 2008 at 1:48 AM, Andrew Premdas wrote: > So I can confirm that I'm logged in, that the user is who I say he is, etc. > > e.g > > Then /^I should be logged in$/ do > controller.logged_in?.should be_true Or: controller.should be_logged_in Aslak > > end > > makes sense? > > 20

Re: [rspec-users] step definitons to check login

2008-12-16 Thread Zach Dennis
On Tue, Dec 16, 2008 at 7:48 PM, Andrew Premdas wrote: > So I can confirm that I'm logged in, that the user is who I say he is, etc. > > e.g > > Then /^I should be logged in$/ do > controller.logged_in?.should be_true > end > > makes sense? I know why you're doing it, but I just want to know *w

Re: [rspec-users] step definitons to check login

2008-12-16 Thread Andrew Premdas
So I can confirm that I'm logged in, that the user is who I say he is, etc. e.g Then /^I should be logged in$/ do controller.logged_in?.should be_true end makes sense? 2008/12/16 Zach Dennis > On Tue, Dec 16, 2008 at 6:47 PM, Andrew Premdas > wrote: > > Doing this for Restful-Authenticatio

Re: [rspec-users] step definitons to check login

2008-12-16 Thread Zach Dennis
On Tue, Dec 16, 2008 at 6:47 PM, Andrew Premdas wrote: > Doing this for Restful-Authentication I add the following in > features/support/env.rb > > # Make visible for testing > ApplicationController.send(:public, :logged_in?, :current_user, > :authorized?) Why do you need these available for cucu

Re: [rspec-users] step definitons to check login

2008-12-16 Thread Andrew Premdas
Doing this for Restful-Authentication I add the following in features/support/env.rb # Make visible for testing ApplicationController.send(:public, :logged_in?, :current_user, :authorized?) Hopefully something similar will work with Authlogic Andrew 2008/12/16 James Byrne > I am working with

Re: [rspec-users] step definitons to check login

2008-12-16 Thread David Chelimsky
On Tue, Dec 16, 2008 at 1:34 PM, James Byrne wrote: > I am working with the authlogic gem and trying to create a simple login > test from cucumber features. The feature statement is: > > Given the user is not logged in > > The step definition for this is confounding me. In the > application_contr

[rspec-users] step definitons to check login

2008-12-16 Thread James Byrne
I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the application_controller the authlogic tutorial recommends the following: private