In the controller spec, I can set http accept header like this:
request.accept = \"application/json\"
but in the request spec, \"request\"
To send both xhr: true and headers, I had to do e.g.:
xhr: true
my_headers = { "HTTP_ACCEPT": "application/json" } get my_path, xhr: true, headers: my_headers