Sha256: db6cea8466e1a005365d540476d1db5b489533cbe0753d123fd868acda0ef2a5

Contents?: true

Size: 546 Bytes

Versions: 12

Compression:

Stored size: 546 Bytes

Contents

require 'spec_helper'

describe ZendeskAPI::Middleware::Request::EtagCache do
  it "caches" do
    client.config.cache.size = 1

    stub_json_request(:get, %r{blergh}, '{"x":1}', :headers => {"Etag" => "x"})
    response = client.connection.get("blergh")
    response.status.should == 200
    response.body.should == {"x"=>1}

    stub_request(:get, %r{blergh}).to_return(:status => 304, :headers => {"Etag" => "x"})
    response = client.connection.get("blergh")
    response.status.should == 304
    response.body.should == {"x"=>1}
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
zendesk_api-0.1.11 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.10 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.9 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.8 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.7 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.6 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.5 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.4 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.3 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.2 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.1.1 spec/middleware/request/etag_cache_spec.rb
zendesk_api-0.0.9 spec/middleware/request/etag_cache_spec.rb