Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #5924 (new defect)

Opened 2 years ago

Last modified 5 months ago

[PATCH] Retrieve cookie with symbol return nil in functional test

Reported by: herryanto@pluitsolutions.com Assigned to: sandofsky
Priority: normal Milestone:
Component: ActionPack Version: edge
Severity: normal Keywords: cookie functional test nil symbol
Cc:

Description

Cookie retrieved in functional test using symbol returns nil, but it's fine with string.

def test_cookie
    post :action_to_set_cookie
    assert cookies[:auth_token] # failed even though cookie has been set
    assert cookies['auth_token'] # test passed
end

Attachments

cookies_symbols_and_strings_are_synonymous.diff (1.5 kB) - added by sandofsky on 01/24/07 03:30:59.
In tests, makes symbols and strings in cookies synonymous.

Change History

01/24/07 03:30:09 changed by sandofsky

  • owner changed from David to sandofsky.

In my patch, if you pass cookies a symbol in your test, it will apply its .to_s to get the string key.

01/24/07 03:30:59 changed by sandofsky

  • attachment cookies_symbols_and_strings_are_synonymous.diff added.

In tests, makes symbols and strings in cookies synonymous.

01/24/07 03:31:34 changed by sandofsky

  • summary changed from Retrieve cookie with symbol return nil in functional test to [PATCH] Retrieve cookie with symbol return nil in functional test.

02/22/08 15:03:17 changed by nicholas.henry

+1