module Affirm::TestingSupport::HttpResponses

Public Instance Methods

read_http_fixture(name) click to toggle source
# File lib/affirm/testing_support/http_responses.rb, line 21
def read_http_fixture(name)
  File.read(File.join(File.dirname(__FILE__), "fixtures.http", name))
end
read_json_fixture(name) click to toggle source
# File lib/affirm/testing_support/http_responses.rb, line 25
def read_json_fixture(name)
  JSON.parse(File.read(File.join(File.dirname(__FILE__), "fixtures.json", name)))
end
stub_basic_auth() click to toggle source
# File lib/affirm/testing_support/http_responses.rb, line 14
def stub_basic_auth
  [
    Affirm.config.public_api_key,
    Affirm.config.private_api_key
  ]
end
stub_headers() click to toggle source
# File lib/affirm/testing_support/http_responses.rb, line 6
def stub_headers
  {
    "Accept" => "application/json",
    "Content-type" => "application/json",
    "User-Agent" => /^Affirm\/#{Affirm::VERSION} Ruby\/#{RUBY_VERSION} OpenSSL\/.*$/
  }
end