Sha256: 34f19791a598d49d8bca4b2ca6ef6b27ed293cd3c9fafeba0ba37361253e72b5

Contents?: true

Size: 654 Bytes

Versions: 11

Compression:

Stored size: 654 Bytes

Contents

require 'core/spec_helper'

describe ZendeskAPI::Middleware::Response::Gzip do
  context "with content-encoding = 'gzip'" do
    subject { '{ "TESTDATA": true }' }
    before(:each) do
      encoded_data = StringIO.new
      gz = Zlib::GzipWriter.new(encoded_data)
      gz.write(subject)
      gz.close

      stub_request(:get, %r{blergh}).to_return(
        :headers => {
          :content_encoding => "gzip",
          :content_type => "application/json"
        },
        :body => encoded_data.string
      )
    end

    it "should inflate returned body" do
      client.connection.get("blergh").body['TESTDATA'].should be_true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
zendesk_api-1.3.9 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.8 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.7 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.5 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.4 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.2 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.1 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.0 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.0.rc3 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.0.rc2 spec/core/middleware/response/gzip_spec.rb
zendesk_api-1.3.0.rc1 spec/core/middleware/response/gzip_spec.rb