Skip to content

Instantly share code, notes, and snippets.

View aka47's full-sized avatar
💭
I may be slow to respond.

Tim Aßmann aka47

💭
I may be slow to respond.
View GitHub Profile
# Rack::Test doesn't support hitting external webservers. However, when a user enters their credit card info,
# it is submitted directly to braintree, so we need to intregration test with hitting an external server.
# This hack enabled this, by swapping out the Rack::Test's rack app with a Rack::Client instance.
# Rack::Client acts just like a rack app, but under the covers it delegates to Net::HTTP.
require 'rack/client'
module RackTestHack
def new(*a, &b)