Sha256: dcfc201abd828d36a0d5f15877107518f6c5acac1f1ac94513019d1a5481c565
Contents?: true
Size: 609 Bytes
Versions: 30
Compression:
Stored size: 609 Bytes
Contents
require 'rack/test' module Airborne module RackTestRequester def make_request(method, url, options = {}) headers = options[:headers] || {} base_headers = Airborne.configuration.headers || {} headers = base_headers.merge(headers) browser = Rack::Test::Session.new(Rack::MockSession.new(Airborne.configuration.rack_app)) headers.each { |name, value| browser.header(name, value) } browser.send(method, url, options[:body] || {}, headers) Rack::MockResponse.class_eval do alias_method :code, :status end browser.last_response end end end
Version data entries
30 entries across 30 versions & 2 rubygems