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
Rails 5 no hacks:
put(:update, params: {project_id: 1}, body: {name: 'Updated Project 1'}.to_json, as: :json)
This sets the content_type correctly. In the controller params will hold both params and body.
content_type
params