Sha256: 9e375ecc020cf1fe448ec3450a7388b154b3dc991582203814b941ba6d80db2b

Contents?: true

Size: 690 Bytes

Versions: 3

Compression:

Stored size: 690 Bytes

Contents

require 'rack/mock'
require 'rack/test'
require 'spec_helper'
require 'request_tracer/trace'
require 'logger'
require 'webmock/rspec'
require 'rest-client'

describe RequestTracer::Integration::RestClientHandler do
  include RequestTracer::Integration::Base
  RequestTracer.integrate_with(:rest_client)
  before(:all) { WebMock.disable_net_connect! }
  before do
    stub_request(:any, "www.example.com")
  end

  let(:trace) { RequestTracer::Trace.latest }
  it "should have set the headers on the outgoing call" do
    RestClient.get("www.example.com")
    expect(WebMock).to have_requested(:get, "www.example.com").
      with(headers: extract_headers_from_fields(trace.to_h))
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
request-tracer-0.5.4 spec/lib/request_tracer/integration/rest_client_handler_spec.rb
request-tracer-0.5.3 spec/lib/request_tracer/integration/rest_client_handler_spec.rb
request-tracer-0.5.2 spec/lib/request_tracer/integration/rest_client_handler_spec.rb