Sha256: 1e254d79ec89ddbb4d37070c0222679cc9532ba627d6a2e9f4d8492a9a5a2357

Contents?: true

Size: 723 Bytes

Versions: 1

Compression:

Stored size: 723 Bytes

Contents

require 'rack/test'

def app
  Rails.application
end

module DSL
  module RackTest
    module Route
      extend ActiveSupport::Concern

      def send_request(verb, route, body)
        header 'Accept', 'application/json'
        send verb, route, body
      end
    end
  end
end


module DSL
  module RackTest
    module Request
      extend ActiveSupport::Concern

      def response
        last_response
      end

      def request_params
        last_request.params
      end
    end
  end
end


RSpec.configuration.include Rack::Test::Methods, rspec_api_dsl: :route
RSpec.configuration.include DSL::RackTest::Route, rspec_api_dsl: :route
RSpec.configuration.include DSL::RackTest::Request, rspec_api_dsl: :request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-api-0.1.0 lib/rspec-api/http/rack_test.rb