In the controller spec, I can set http accept header like this:
request.accept = "application/json"
but in the request spec, "request" object is nil. So how can I do it here?
The reason I want to set http accept header to json is so I can do this:
get '/my/path'
instead of this
get '/my/path.json'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…