I\'m trying to build an rspec test that sends JSON (or XML) via POST. However, I can\'t seem to actually get it working:
json = {.... data ....}.to_json
I think that you can specify the headers with headers param:
headers
post '/model1.json', headers: {'Content-type': 'application/json'}
Following the Rspec documentation of how provide JSON data.