On 7 June 2011 15:53, Mauro <mrsan...@gmail.com> wrote: > On 7 June 2011 14:48, Colin Law <clan...@googlemail.com> wrote: >> On 7 June 2011 15:45, Mauro <mrsan...@gmail.com> wrote: >>> I'm using devise and in application_controller I have before_filter >>> :authenticate! >>> In sector_controller I have: >>> >>> skip_filter :authenticate_user!, :only => [:index, >>> :search_categories_by_sector] >>> >>> When I run rspec it says: undefined method authenticate!, even for >>> index action. >>> But I' set skip_filter for index action. >>> Why rspec needs authenticate for index? >> >> Because you have specified skip for :authenticate_user! not :authenticate! ? > > I've make a mistake writing, in application_controller I have: > before_filter :authenticate_user!
In that case, as you are getting an error 'undefined method authenticate!' that is nothing to do with the filter. It is no good re-typing what you think you have when asking questions, it is vital that we know *exactly* what you have. I suggest that you copy and paste the relevant code out of application_controller.rb and sector_controller.rb and also copy and paste the test that is failing and the error. Colin -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.