Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

TestSession and AbstractStore delete and update methods do not match in parameter count

#1801

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.

Reported by gaffo · January 26th, 2009 @ 11:51 PM

State: resolved
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. Pratik
    Pratik
    • Milestone cleared.
    • Assigned user set to josh

    January 26th, 2009 @ 11:52 PM

  2. gaffo
    gaffo
    • Assigned user cleared.

    working on a patch now.

    January 27th, 2009 @ 12:30 AM

  3. gaffo
    gaffo

    Should be fixed with attached patch. Also backfilled some tests on TestSession (didn't have any that I could find).

    January 27th, 2009 @ 01:03 AM

  4. Amos King
    Amos King

    backfilled tests, and fixed a bug. +2

    January 27th, 2009 @ 02:05 PM

  5. yairgo
  6. josh
    josh
    • State changed from new to open
    • Assigned user set to josh

    January 27th, 2009 @ 03:30 PM

  7. Repository
    Repository
    • State changed from open to resolved

    (from [f17c87665e36206bcae9c260cb25cd67bf9695e6]) Fixed deprecated methods on TestSession [#1801 state:resolved] http://github.com/rails/rails/co...

    January 27th, 2009 @ 06:23 PM

  8. Amos King
    Amos King

    Josh, why didn't you take the tests that gaffo had committed?

    January 27th, 2009 @ 07:04 PM

  9. Michael Koziarski
    Michael Koziarski
    • State changed from resolved to open

    Why weren't the tests taken?

    January 29th, 2009 @ 04:38 AM

  10. josh
    josh

    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.

    January 29th, 2009 @ 05:05 AM

  11. gaffo
  12. Repository
    Repository
    • 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...

    January 30th, 2009 @ 01:34 AM