Sha256: 4260fea99038239350858e30a4506a984249dfe3b88cd66939fb1c5e688adf74

Contents?: true

Size: 692 Bytes

Versions: 2

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'
require File.join(File.dirname(__FILE__), '../../', 'examples/echo')


describe Goliath::Rack::Tracer do
  let(:err) { Proc.new { fail "API request failed" } }

  it 'injects a trace param on a 200 (via async callback)' do
    with_api(Echo) do
      get_request({:query => {:echo => 'test'}}, err) do |c|
        expect(c.response_header['X_POSTRANK']).to match(/trace\.start: [\d\.]+, total: [\d\.]+/)
      end
    end
  end

  it 'injects a trace param on a 400 (direct callback)' do
    with_api(Echo) do
      get_request({}, err) do |c|
        expect(c.response_header['X_POSTRANK']).to match(/trace\.start: [\d\.]+, total: [\d\.]+/)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
goliath-1.0.7 spec/integration/trace_spec.rb
goliath-1.0.6 spec/integration/trace_spec.rb