0

I'm looking to send raw cookie string to application controller for testing. One of the 'before filters' must scan raw cookie data (unescaped '+' => ' ') and decrypt it.

request.env['rack.request.cookie_string']

I tried several approaches with @cookies, @request.cookies etc., none of them worked. When the test executed 'get page', cookie wasn't found.

4

1 回答 1

2

A solution to this problem is to execute:

@request.env['HTTP_COOKIE'] = your_unescaped_cookie_string

before

get page

in the functional test

于 2014-03-23T12:35:53.920 回答