Testing POST ActionDispatch::Http::Parameters::ParseError: 765

Removing the 'Content-Type' => 'application/json' solved the problem.

Finally remembered that ActionDispatch uses the headers to know how to parse the params. 'Content-Type' => 'application/json' is a standard piece of boilerplate that's ok to throw around with GET requests and query params but not with POST when used this way.


In case you still want 'Content-Type' => 'application/json': You should pass params to raw_post and call #to_json on the params that you pass.

Like:

    let(:raw_post) { params.to_json }