Here is a small addition to the Sergio answer . If you upgrade from Rails 4 to Rails 5, you have a lot of tests and are not too interested in changing them - at least until you finish the upgrade - I found a way to get them to work with the old method signature.
In my spec_helper I added
module FixLegacyTestRequests def get(path, par = {}, hdr = {}) process(:get, path, params: par, headers: hdr) end def post(path, par = {}, hdr = {}) process(:post, path, params: par, headers: hdr) end def put(path, par = {}, hdr = {}) process(:put, path, params: par, headers: hdr) end def delete(path, par = {}, hdr = {}) process(:delete, path, params: par, headers: hdr) end end
and then I added this configuration for each test:
RSpec.configure do |config| config.before :each do |example| extend(FixLegacyTestRequests)
My tests returned to work, and I think it should be safe, because it only applies to current testing and should not contaminate any gem code, such as a monkey patch.
source share