Sha256: 7950159de21e168e19a5ec4ed63bbccf83578c5826d733a06b23a7fbca456d91

Contents?: true

Size: 685 Bytes

Versions: 4

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

require 'fakeweb'
FakeWeb.allow_net_connect = false

def fake_post(path, response)
  FakeWeb.register_uri(:post, "https://pi.pardot.com#{path}", body: response)
end

def fake_get(path, response)
  FakeWeb.register_uri(:get, "https://pi.pardot.com#{path}", body: response)
end

def fake_authenticate(client, api_key)
  client.api_key = api_key
end

def assert_authorization_header(auth_manager)
  expect(FakeWeb.last_request[:authorization]).to eq(auth_manager.expected_authorization_header)
  if auth_manager.has_business_unit_id_header?
    expect(FakeWeb.last_request['Business-Unit-Id']).to eq(auth_manager.expected_business_unit_id_header)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-pardot-1.4.3 spec/support/fakeweb.rb
ruby-pardot-1.4.2 spec/support/fakeweb.rb
ruby-pardot-1.4.1 spec/support/fakeweb.rb
ruby-pardot-1.4.0 spec/support/fakeweb.rb