#81 ✓resolved
Andrew Vit

Error destroying session with extra parameters in tests

Reported by Andrew Vit | April 5th, 2009 @ 08:13 AM

I'm running into this problem in my rSpec controller tests. I'm getting an ArgumentError internal to Authlogic when deleting cookies, as part of destroying a session:


wrong number of arguments (2 for 1)
./vendor/plugins/authlogic/lib/authlogic/session/cookies.rb:123:in `delete'
./vendor/plugins/authlogic/lib/authlogic/session/cookies.rb:123:in `destroy_cookie'
./vendor/plugins/authlogic/lib/authlogic/session/callbacks.rb:71:in `after_destroy'
./vendor/plugins/authlogic/lib/authlogic/session/existence.rb:48:in `destroy'

I set a breakpoint in authlogic/session/cookies.rb:123 (in destroy_cookie method) to see what's going on:

   122            def destroy_cookie
   123              breakpoint
=> 124              controller.cookies.delete cookie_key, :domain => controller.cookie_domain
   125            end

(rdb:1) cookie_key

(rdb:1) controller.cookie_domain

(rdb:1) controller.cookies

(rdb:1) controller.cookies.class

(rdb:1) controller.cookies.delete cookie_key, :domain => controller.cookie_domain
ArgumentError Exception: wrong number of arguments (2 for 1)

Looks like cookies is a Hash here, not a ActionController::CookieJar (nor a Mock CookieJar) so the params don't fit the delete method from Hash.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket