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-10.1.2 spec/interceptors/caching/parameters_spec.rb
lhc-10.1.1 spec/interceptors/caching/parameters_spec.rb
lhc-10.1.0 spec/interceptors/caching/parameters_spec.rb
lhc-10.0.2 spec/interceptors/caching/parameters_spec.rb
lhc-9.4.4 spec/interceptors/caching/parameters_spec.rb
lhc-10.0.1 spec/interceptors/caching/parameters_spec.rb
lhc-10.0.0 spec/interceptors/caching/parameters_spec.rb
lhc-9.4.3 spec/interceptors/caching/parameters_spec.rb
lhc-9.4.2 spec/interceptors/caching/parameters_spec.rb
lhc-9.4.1 spec/interceptors/caching/parameters_spec.rb
lhc-9.4.0 spec/interceptors/caching/parameters_spec.rb
lhc-9.3.1 spec/interceptors/caching/parameters_spec.rb
lhc-9.3.0 spec/interceptors/caching/parameters_spec.rb
lhc-9.2.0 spec/interceptors/caching/parameters_spec.rb
lhc-9.1.2 spec/interceptors/caching/parameters_spec.rb
lhc-9.1.2.pre spec/interceptors/caching/parameters_spec.rb
lhc-9.1.1 spec/interceptors/caching/parameters_spec.rb
lhc-8.1.1 spec/interceptors/caching/parameters_spec.rb
lhc-9.1.0 spec/interceptors/caching/parameters_spec.rb
lhc-9.0.0 spec/interceptors/caching/parameters_spec.rb