Sending raw JSON data to a member action in a controller spec

This is what worked for me in a Rails 4:

# JSON data as first argument, then parameters
patch :update, { some: 'data' }.to_json, id: id, format: :json