Sha256: e27a532694af0377ed2e4b4b8d540adb12187a29eec73c56386891da7f6c6362

Contents?: true

Size: 484 Bytes

Versions: 68

Compression:

Stored size: 484 Bytes

Contents

# Backport the Rails 5 controller test methods to Rails 4
module BackportTest
  [:delete, :get, :post, :put, :patch].each do |http_action|
    define_method(http_action) do |*args|
      (action, rest) = *args
      rest ||= {}
      if rest[:xhr]
        @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
        @request.env['HTTP_ACCEPT'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ')
      end
      super(action, rest[:params])
    end
  end
end

Version data entries

68 entries across 68 versions & 4 rubygems

Version Path
blacklight-6.25.0 spec/support/backport_test.rb
blacklight-6.24.0 spec/support/backport_test.rb
blacklight-6.23.0 spec/support/backport_test.rb
blacklight-6.22.0 spec/support/backport_test.rb
blacklight-6.21.0 spec/support/backport_test.rb
blacklight-6.20.0 spec/support/backport_test.rb
blacklight-6.19.2 spec/support/backport_test.rb
blacklight-6.19.1 spec/support/backport_test.rb
blacklight-6.19.0 spec/support/backport_test.rb
blacklight-6.18.0 spec/support/backport_test.rb
blacklight-6.17.0 spec/support/backport_test.rb
blacklight-6.16.0 spec/support/backport_test.rb
blacklight-6.15.0 spec/support/backport_test.rb
blacklight-6.14.1 spec/support/backport_test.rb
blacklight-6.14.0 spec/support/backport_test.rb
blacklight-6.13.0 spec/support/backport_test.rb
blacklight-6.12.0 spec/support/backport_test.rb
curation_concerns-1.7.8 spec/support/backport_test.rb
geo_works-0.2.0 spec/support/backport_test.rb
blacklight-6.11.2 spec/support/backport_test.rb