I\'m using the rails-api gem to build a web service and want to test my API with RSpec. Every request I make, regardless of the HTTP method has the CONTENT_TYPE hea
CONTENT_TYPE
This worked for me Rails 4.0.3 and Rspec 2.14.1 if anyone is looking for more recent versions.
put '/projects/1.json', {name: 'Updated Project 1'}, { 'HTTP_ACCEPT' => 'application/json', 'CONTENT_TYPE' => 'application/json' }
and
wrap_parameters Project, format: :json