Sha256: 210201c2eb111ae8c1a89ce8cf2476eefb0d179596e4220cbe9f9b51d470fc96

Contents?: true

Size: 931 Bytes

Versions: 6809

Compression:

Stored size: 931 Bytes

Contents

require 'spec_helper'

describe Typhoeus::Request::Memoizable do
  let(:options) { {} }
  let(:request) { Typhoeus::Request.new("fu", options) }
  let(:response) { Typhoeus::Response.new }
  let(:hydra) { Typhoeus::Hydra.new }

  describe "#response=" do
    context "when memoization activated" do
      before { Typhoeus::Config.memoize = true }
      after { Typhoeus::Config.memoize = false }

      context "when GET request" do
        let(:options) { {:method => :get} }
        before { request.hydra = hydra }

        it "stores response in memory" do
          request.response = response
          expect(hydra.memory[request]).to be
        end
      end

      context "when no GET request" do
        let(:options) { {:method => :post} }

        it "doesn't store response in memory" do
          request.response = response
          expect(hydra.memory[request]).to be_nil
        end
      end
    end
  end
end

Version data entries

6,809 entries across 6,806 versions & 27 rubygems

Version Path
ory-client-0.0.1.alpha27 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-client-0.0.1.alpha24 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-client-0.0.1.alpha23 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.8.0.alpha2 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-client-0.0.1.alpha21 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-keto-client-0.7.0.alpha1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-keto-client-0.7.0.alpha0 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.6.alpha7 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.6.alpha6 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.6.alpha5 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.6.alpha4 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.6.alpha3 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.6.alpha1 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
ory-kratos-client-0.7.5.alpha2 vendor/bundle/ruby/2.5.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
cloudsmith-api-0.57.1 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
mfk_openapi_ruby_client-1.0.0 vendor/bundle/ruby/2.7.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
cloudsmith-api-0.54.15 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
cloudsmith-api-0.53.79 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
cloudsmith-api-0.53.17 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb
cloudsmith-api-0.53.3 vendor/bundle/ruby/2.6.0/gems/typhoeus-1.4.0/spec/typhoeus/request/memoizable_spec.rb