dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Dec-30 21:28 UTC
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded today) and upon running the generator, doing the migration, prepping the test system and putting the resources in routes.rb I get a Rspec test failure: ''SessionsController logins and redirects'' FAILED expected not nil, got nil routes.rb has: map.resources :users map.resources :sessions nothing else was changed or done. there is only one other controller/ model in the system and rspec tested it with no errors. Is this a known bug? Should I just be using something else? I have used this several times on 1.2.6 with no problem. Thanks Don French --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Check your routes again. You are showing:> routes.rb has: > map.resources :users > map.resources :sessionsIt should be: map.resources :users map.resource :session Note the singular form for session. Each user can only have one session at a time so it''s singular. On Dec 30, 4:28 pm, "dhf0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <dhf0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am trying the Restful-Authentication (latest version, downloaded > today) and upon running the generator, doing the migration, prepping > the test system and putting the resources in routes.rb I get a Rspec > test failure: > > ''SessionsController logins and redirects'' FAILED > expected not nil, got nil > > routes.rb has: > map.resources :users > map.resources :sessions > > nothing else was changed or done. there is only one other controller/ > model in the system and rspec tested it with no errors. > > Is this a known bug? Should I just be using something else? I have > used this several times on 1.2.6 with no problem. > > Thanks > > Don French--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Dec-31 20:57 UTC
Re: Restful-Authentication Rspec Failure Rails 2.0.2
I tried that before and just did. Same error. code around the failure is: it ''logins and redirects'' do post :create, :login => ''quentin'', :password => ''test'' session[:user].should_not be_nil # -> Error is on this line response.should be_redirect end Error is: 1) ''SessionsController logins and redirects'' FAILED expected not nil, got nil /Users/dhf/NetBeansProjects/snrbad/spec/controllers/ sessions_controller_spec.rb:12: Finished in 0.145385 seconds 9 examples, 1 failure On Dec 30, 3:14 pm, Robert Walker <rwalker...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Check your routes again. > > You are showing: > > > routes.rb has: > > map.resources :users > > map.resources :sessions > > It should be: > map.resources :users > map.resource :session > > Note the singular form for session. Each user can only have one > session at a time so it''s singular. > > On Dec 30, 4:28 pm, "dhf0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <dhf0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am trying the Restful-Authentication (latest version, downloaded > > today) and upon running the generator, doing the migration, prepping > > the test system and putting the resources in routes.rb I get a Rspec > > test failure: > > > ''SessionsController logins and redirects'' FAILED > > expected not nil, got nil > > > routes.rb has: > > map.resources :users > > map.resources :sessions > > > nothing else was changed or done. there is only one other controller/ > > model in the system and rspec tested it with no errors. > > > Is this a known bug? Should I just be using something else? I have > > used this several times on 1.2.6 with no problem. > > > Thanks > > > Don French--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 31, 2007 12:57 PM, dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I tried that before and just did. Same error. > > code around the failure is: > it ''logins and redirects'' do > post :create, :login => ''quentin'', :password => ''test'' > session[:user].should_not be_nil # -> Error is on this line > response.should be_redirect > end > > Error is: > 1) > ''SessionsController logins and redirects'' FAILED > expected not nil, got nil > /Users/dhf/NetBeansProjects/snrbad/spec/controllers/ > sessions_controller_spec.rb:12: > > Finished in 0.145385 seconds > > 9 examples, 1 failureChanges in your app can cause these test failures. I very recently used the rspec version when it was committed and had no problems. It''s only a restful_auth issue if it does this on a brand new app. Please do send a patch if you uncover a bug. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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-/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 -~----------~----~----~----~------~----~------~--~---
> It''s only a restful_auth issue if it does this on a brand new app.It does this to me on a brand new app.> Please do send a patch if you uncover a bug.--- functional_spec.rb.orig 2007-12-31 17:33:13.000000000 -0500 +++ functional_spec.rb 2007-12-31 18:13:20.000000000 -0500 @@ -9,20 +9,20 @@ it ''logins and redirects'' do post :create, :login => ''quentin'', :password => ''test'' - session[:<%= file_name %>].should_not be_nil + session[:<%= file_name %>_id].should_not be_nil response.should be_redirect end it ''fails login and does not redirect'' do post :create, :login => ''quentin'', :password => ''bad password'' - session[:<%= file_name %>].should be_nil + session[:<%= file_name %>_id].should be_nil response.should be_success end it ''logs out'' do login_as :quentin get :destroy - session[:<%= file_name %>].should be_nil + session[:<%= file_name %>_id].should be_nil response.should be_redirect end --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Dec 31, 2007 3:17 PM, Bryan Larsen <bryan.larsen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > It''s only a restful_auth issue if it does this on a brand new app. > > It does this to me on a brand new app. > > > Please do send a patch if you uncover a bug. > > --- functional_spec.rb.orig 2007-12-31 17:33:13.000000000 -0500 > +++ functional_spec.rb 2007-12-31 18:13:20.000000000 -0500 > @@ -9,20 +9,20 @@ > > it ''logins and redirects'' do > post :create, :login => ''quentin'', :password => ''test'' > - session[:<%= file_name %>].should_not be_nil > + session[:<%= file_name %>_id].should_not be_nil > response.should be_redirect > end > > it ''fails login and does not redirect'' do > post :create, :login => ''quentin'', :password => ''bad password'' > - session[:<%= file_name %>].should be_nil > + session[:<%= file_name %>_id].should be_nil > response.should be_success > end > > it ''logs out'' do > login_as :quentin > get :destroy > - session[:<%= file_name %>].should be_nil > + session[:<%= file_name %>_id].should be_nil > response.should be_redirect > endOh awesome, someone gets reprimanded for not testing before committing :) Thanks. -- Rick Olson http://lighthouseapp.com http://weblog.techno-weenie.net http://mephistoblog.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-/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 -~----------~----~----~----~------~----~------~--~---
dhf0820-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jan-01 05:35 UTC
Re: Restful-Authentication Rspec Failure Rails 2.0.2
Thanks. I thought I had tried everything before I submitted the problem. I even had done but did not mention what Rick had recommended and it failed also. When will then plugin be updated so I do not have to make the changes on each project? Don French On Dec 31, 4:06 pm, "Rick Olson" <technowee...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Dec 31, 2007 3:17 PM, Bryan Larsen <bryan.lar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > It''s only a restful_auth issue if it does this on a brand new app. > > > It does this to me on a brand new app. > > > > Please do send a patch if you uncover a bug. > > > --- functional_spec.rb.orig 2007-12-31 17:33:13.000000000 -0500 > > +++ functional_spec.rb 2007-12-31 18:13:20.000000000 -0500 > > @@ -9,20 +9,20 @@ > > > it ''logins and redirects'' do > > post :create, :login => ''quentin'', :password => ''test'' > > - session[:<%= file_name %>].should_not be_nil > > + session[:<%= file_name %>_id].should_not be_nil > > response.should be_redirect > > end > > > it ''fails login and does not redirect'' do > > post :create, :login => ''quentin'', :password => ''bad password'' > > - session[:<%= file_name %>].should be_nil > > + session[:<%= file_name %>_id].should be_nil > > response.should be_success > > end > > > it ''logs out'' do > > login_as :quentin > > get :destroy > > - session[:<%= file_name %>].should be_nil > > + session[:<%= file_name %>_id].should be_nil > > response.should be_redirect > > end > > Oh awesome, someone gets reprimanded for not testing before committing > :) Thanks. > > -- > Rick Olsonhttp://lighthouseapp.comhttp://weblog.techno-weenie.nethttp://mephistoblog.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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---