Sha256: 9de9ecc1117560a72531cb82edd9e62feecd59b2081c6d6f672e8f5a5e4d277e

Contents?: true

Size: 598 Bytes

Versions: 11

Compression:

Stored size: 598 Bytes

Contents

require "test_helper"

describe Pliny::Middleware::RequestID do
  def app
    Rack::Builder.new do
      use Rack::Lint
      use Pliny::Middleware::RequestID
      run Sinatra.new {
        get "/" do
          env["REQUEST_IDS"].join(",")
        end
      }
    end
  end

  it "tags responses with Request-Id" do
    get "/"
    assert_match Pliny::Middleware::RequestID::UUID_PATTERN,
      last_response.headers["Request-Id"]
  end

  it "accepts incoming request IDs" do
    id = SecureRandom.uuid
    header "Request-Id", id
    get "/"
    assert_includes last_response.body, id
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pliny-0.4.0 test/middleware/request_id_test.rb
pliny-0.3.0 test/middleware/request_id_test.rb
pliny-0.2.1 test/middleware/request_id_test.rb
pliny-0.2.0 test/middleware/request_id_test.rb
pliny-0.1.0 test/middleware/request_id_test.rb
pliny-0.0.4 test/middleware/request_id_test.rb
pliny-0.0.3 test/middleware/request_id_test.rb
pliny-0.0.1 test/middleware/request_id_test.rb
pliny-0.0.1.pre3 test/middleware/request_id_test.rb
pliny-0.0.1.pre2 test/middleware/request_id_test.rb
pliny-0.0.1.pre test/middleware/request_id_test.rb