Question

I want to set a cookie when making a request with Rack::MockRequest

cookie = "_session_id=123"
client = Rack::MockRequest.new(@app)

#something like this?
response = client.get("/", "Cookie" => cookie) 

How do I do it?

Was it helpful?

Solution

try

response = client.get('/', "HTTP_COOKIE" => cookie)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top