Sha256: 19d3092b8c49de0d2934faff46a9de294d7e4b3d01d3087b35205b2e153f4c65

Contents?: true

Size: 717 Bytes

Versions: 44

Compression:

Stored size: 717 Bytes

Contents

require 'rails_helper'

describe LHC::Caching do
  context 'parameters' do
    before(:each) do
      LHC.config.interceptors = [LHC::Caching]
      Rails.cache.clear
    end

    it 'considers parameters when writing/reading from cache' do
      LHC.config.endpoint(:local, 'http://local.ch', cache: true)
      stub_request(:get, 'http://local.ch').to_return(status: 200, body: 'The Website')
      stub_request(:get, 'http://local.ch?location=zuerich').to_return(status: 200, body: 'The Website for Zuerich')
      expect(
        LHC.get(:local).body
      ).to eq 'The Website'
      expect(
        LHC.get(:local, params: { location: 'zuerich' }).body
      ).to eq 'The Website for Zuerich'
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

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