Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Rails 2.3.5 incompatibility #76

knapo opened this Issue · 3 comments

3 participants

Krzysztof Knapik Bob Sturim Elise Huard
Krzysztof Knapik

After upgrading to Rails 2.3.5 lot of tests fail on:

Message: NoMethodError: protected method `cookies' 
called for #<ActionView::TestCase::TestController:0x7f385cfeb1e0>
`cookie_credentials' vendor/bundler_gems/gems/authlogic-2.1.3/lib/authlogic/session/cookies.rb:106:in `persist_by_cookie' 
Bob Sturim

I'm getting the same problem running with AuthLogic 2.1.3.

Krzysztof Knapik

Because Rails 2.3.5 introduces lot of changes in tests (mostly in ActionView::TestCase) the controler method from Authlogic::TestCase no longer works and (sometimes) returns regular test controller instead of Authlogic mocked one.

I fixed it with a small change in lib/authlogic/test_case.rb (actually by adding it to my test_helper, as we need to require 'authlogic/test_case' anyway):

def activate_authlogic
  Authlogic::Session::Base.controller = (@request && || mock_controller

def mock_controller
  @mock_controller ||=
Elise Huard

many thanks, that seems to help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.