This project is archived and is in readonly mode.
TestSession and AbstractStore delete and update methods do not match in parameter count
Reported by gaffo | January 26th, 2009 @ 11:51 PM
Now that we have moved to AbstractStore for rails (non cookie) sessions, the delete and update methods for the test session also exist in the Session via it's subclassing of Hash, but they take different parameter counts.
When in test mode, the delete and update methods without parameters will work fine, but calling those on a SessionHash now give you wrong parameter count 0 for 1. Using the syntax that SessionHash expects gives you a missing parameters 1 for 0 when running tests.
I would propose the following steps: 1) Create save_test_session and clear_test_session functions that implement the current functionality in test_session 2) When delete or update are called without parameters, issue a deprecation warning and tell users to use methods in #1. 3) When the users calls update or delete with parameters, pass them onto calls on @attributes.
Comments and changes to this ticket
-
Pratik January 26th, 2009 @ 11:52 PM
- Milestone cleared.
- Assigned user set to josh
-
gaffo January 27th, 2009 @ 01:03 AM
Should be fixed with attached patch. Also backfilled some tests on TestSession (didn't have any that I could find).
-
josh January 27th, 2009 @ 03:30 PM
- State changed from new to open
- Assigned user set to josh
-
Repository January 27th, 2009 @ 06:23 PM
- State changed from open to resolved
(from [f17c87665e36206bcae9c260cb25cd67bf9695e6]) Fixed deprecated methods on TestSession [#1801 state:resolved] http://github.com/rails/rails/co...
-
Amos King January 27th, 2009 @ 07:04 PM
Josh, why didn't you take the tests that gaffo had committed?
-
Michael Koziarski January 29th, 2009 @ 04:38 AM
- State changed from resolved to open
Why weren't the tests taken?
-
josh January 29th, 2009 @ 05:05 AM
I don't think we should add those other helper functions, for an example instead of clear_test_session, you could just use clear since its just a hash.
If you could please update the tests to apply cleanly I'll surely commit them.
-
Repository January 30th, 2009 @ 01:34 AM
- State changed from open to resolved
(from [1b79683171eeb0f5eb07928aeace890dafe773fc]) Deprecation tests for f17c876 [#1801 state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
Attachments
Referenced by
- 1801 TestSession and AbstractStore delete and update methods do not match in parameter count (from [f17c87665e36206bcae9c260cb25cd67bf9695e6]) Fixed d...
- 1801 TestSession and AbstractStore delete and update methods do not match in parameter count (from [1b79683171eeb0f5eb07928aeace890dafe773fc]) Depreca...