In the controller spec, I can set http accept header like this:
request.accept = \"application/json\"
but in the request spec, \"request\"
I'm adding this here, as I got majorly stuck trying to do this in Rails 5.1.rc1
The get method signature is slightly different now.
You need to specify the options after the path as keyword arguments, i.e.
get /some/path, headers: {'ACCEPT' => 'application/json'}
FYI, the full set of keywords arguments are:
params: {}, headers: {}, env: {}, xhr: false, as: :symbol