Facing another bug while integration my rails project with twitter using authlogic-oauth and was facing a problem while running my cucumber test. In my step definition file, I was trying to create a simple User object and the error I was getting was as follow:
undefined method `params' for nil:NilClass (NoMethodError)Upon further investigation. The perpetrator was the authlogic-oauth gem itself. Somehow the gem was trying to find the controller parameters for an oauth token.
NoMethodError: undefined method `params' for nil:NilClass from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.8/lib/active_support/whiny_nil.rb:52:in `method_missing' from /Library/Ruby/Gems/1.8/gems/authlogic-oauth-1.0.8/lib/authlogic_oauth/acts_as_authentic.rb:85:in `authenticating_with_oauth
Turns out it was an easy fix base on this issue. http://github.com/jrallison/authlogic_oauth/issues#issue/2
All you have to do is put the following hack in your rails initializers
module AuthlogicOauth module ActsAsAuthentic module Methods # Fixes issue. See: http://github.com/jrallison/authlogic_oauth/issues/#issue/2 def authenticating_with_oauth? if session_class.controller # Initial request when user presses one of the button helpers (session_class.controller.params && !session_class.controller.params[:register_with_oauth].blank?) || # When the oauth provider responds and we made the initial request (oauth_response && session_class.controller.session && session_class.controller.session[:oauth_request_class] == self.class.name) end end end end end

