Frage

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?

War es hilfreich?

Lösung

try

response = client.get('/', "HTTP_COOKIE" => cookie)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top