I\'m using rspec request to test a JSON API that requires an api-key in the header of each request.
I know I can do this:
get \"/v1/users/janedoe.json\"
I know that this question has already been answered but here's my take on it. Something which worked for me:
request.headers['Authorization'] = token
instead of:
request.env['Authorization'] = token