Sha256: b596d0ffc21dbe0117119f820580dbc8311d092e0a669b34f8bf9f7cfe4ed656

Contents?: true

Size: 552 Bytes

Versions: 4

Compression:

Stored size: 552 Bytes

Contents

RSpec.describe Faraday::Conductivity::RequestId do

  subject(:request_headers) { response.env[:request_headers] }

  it "includes the thread local variable" do
    Thread.current[:request_id] = "my-request-id"
    expect(request_headers["X-Request-Id"]).to eq "my-request-id"
  end

  it "doesn't add the header if there is no request id" do
    Thread.current[:request_id] = nil
    expect(request_headers).not_to have_key "X-Request-Id"
  end

  def connection
    create_connection do |faraday|
      faraday.request :request_id
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
faraday-conductivity-2.0.0 spec/middleware/request_id_spec.rb
faraday-conductivity-1.0.1 spec/middleware/request_id_spec.rb
faraday-conductivity-1.0.0 spec/middleware/request_id_spec.rb
faraday-conductivity-0.3.1 spec/middleware/request_id_spec.rb