Sha256: 46e7e186d9973b073d33ef000fd358298b47d7e31533bf76d4890a773478dcca

Contents?: true

Size: 732 Bytes

Versions: 8

Compression:

Stored size: 732 Bytes

Contents

# Rails 5 deprecates calling HTTP action methods with positional arguments
# in favor of keyword arguments. However, the keyword argument form is only
# supported in Rails 5+. Since we support back to 3.1, we need some sort of shim
# to avoid super noisy deprecations when running tests.
module HTTPMethodShim
  def get(path, params=nil, headers=nil)
    super(path, params: params, headers: headers)
  end

  def put(path, params=nil, headers=nil)
    super(path, params: params, headers: headers)
  end

  def post(path, params=nil, headers=nil)
    super(path, params: params, headers: headers)
  end
end

if Rails::VERSION::MAJOR >= 5
  RSpec.configure do |config|
    config.include HTTPMethodShim, type: :controller
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
clearance-1.16.1 spec/support/http_method_shim.rb
clearance-1.16.0 spec/support/http_method_shim.rb
clearance-1.15.1 spec/support/http_method_shim.rb
clearance-1.15.0 spec/support/http_method_shim.rb
clearance-1.14.2 spec/support/http_method_shim.rb
clearance-1.14.1 spec/support/http_method_shim.rb
clearance-1.14.0 spec/support/http_method_shim.rb
clearance-1.13.0 spec/support/http_method_shim.rb