Sha256: aa5d6da14b33f55c7f9a62c47e1aeb7824db7bbd4735befec2b4a0268a30a08e

Contents?: true

Size: 676 Bytes

Versions: 9

Compression:

Stored size: 676 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|
        c.response_header['X_POSTRANK'].should =~ /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|
        c.response_header['X_POSTRANK'].should =~ /trace\.start: [\d\.]+, total: [\d\.]+/
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
goliath-1.0.5 spec/integration/trace_spec.rb
goliath-1.0.4 spec/integration/trace_spec.rb
goliath-1.0.3 spec/integration/trace_spec.rb
goliath-1.0.2 spec/integration/trace_spec.rb
goliath-1.0.1 spec/integration/trace_spec.rb
goliath-1.0.0 spec/integration/trace_spec.rb
goliath-1.0.0.beta.1 spec/integration/trace_spec.rb
goliath-0.9.4 spec/integration/trace_spec.rb
goliath-0.9.2 spec/integration/trace_spec.rb