Domanda

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?

È stato utile?

Soluzione

try

response = client.get('/', "HTTP_COOKIE" => cookie)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top