It seems that the POST params are expected to be JSON encoded. 795: unexpected token at 'myparam'
is caused when the app tries to JSON decode the params that are not encoded.
Use .to_json
with the post params.
post api_v1_post_path(@myid), {"myparam" => "myvalue"}.to_json , {"X-Some-Header" => "MyValue"}
You may want to use let:
describe 'Test' do
let( :params ){{ myparam: 'myvalue' }}
let( :headers ){{ 'X-Some-Header' => 'MyValue' }}
it 'succeeds' do
post api_v1_post_path(@myid), params.to_json , headers