Sha256: 875885117ce1a0780b50a37c3d7d33dd08be3b4aa7b85621b3062dcf10a7b1f1

Contents?: true

Size: 471 Bytes

Versions: 48

Compression:

Stored size: 471 Bytes

Contents

require 'rails_helper'

describe LHC do
  context 'interceptor' do
    before(:each) do
      class TrackingIdInterceptor < LHC::Interceptor
        def before_request(request)
          request.params[:tid] = 123
        end
      end
      LHC.configure { |c| c.interceptors = [TrackingIdInterceptor] }
    end

    it 'can modify requests before they are send' do
      stub_request(:get, "http://local.ch/?tid=123")
      LHC.get('http://local.ch')
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
lhc-7.3.3 spec/interceptors/before_request_spec.rb
lhc-7.3.2 spec/interceptors/before_request_spec.rb
lhc-7.3.1 spec/interceptors/before_request_spec.rb
lhc-7.3.0 spec/interceptors/before_request_spec.rb
lhc-7.2.0 spec/interceptors/before_request_spec.rb
lhc-7.1.0 spec/interceptors/before_request_spec.rb
lhc-7.0.1 spec/interceptors/before_request_spec.rb
lhc-7.0.0 spec/interceptors/before_request_spec.rb
lhc-7.0.0.beta1 spec/interceptors/before_request_spec.rb
lhc-6.7.2 spec/interceptors/before_request_spec.rb
lhc-6.7.1 spec/interceptors/before_request_spec.rb
lhc-6.7.0 spec/interceptors/before_request_spec.rb
lhc-6.6.0.zipkin.pre.03 spec/interceptors/before_request_spec.rb
lhc-6.6.0.zipkin.pre.02 spec/interceptors/before_request_spec.rb
lhc-6.6.0.zipkin.pre.01 spec/interceptors/before_request_spec.rb
lhc-6.6.0.zipkin.pre spec/interceptors/before_request_spec.rb
lhc-6.6.0 spec/interceptors/before_request_spec.rb
lhc-6.5.0 spec/interceptors/before_request_spec.rb
lhc-6.4.0 spec/interceptors/before_request_spec.rb
lhc-6.3.1 spec/interceptors/before_request_spec.rb