Sha256: 6a569e42124fe700ae1403697d75cb41786df7c70922fa6d73cb3419360e5ea4

Contents?: true

Size: 604 Bytes

Versions: 67

Compression:

Stored size: 604 Bytes

Contents

require 'multi_json'

def raw_fixture(which, status = 200, _as_json = false, headers = {})
  object = Object.new
  allow(object).to receive(:status) { status }
  allow(object).to receive(:headers) { headers }
  allow(object).to receive(:to_s) { File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json" }
  allow(object).to receive(:body) { object.to_s }
  allow(object).to receive(:[]) { |key| object.headers[key] }

  object
end

def json_fixture(which, _as_json = false)
  MultiJson.load(
    File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json"
  )
end

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
contentful-management-3.10.0 spec/support/json_responses.rb
contentful-management-3.9.0 spec/support/json_responses.rb
contentful-management-3.8.0 spec/support/json_responses.rb
contentful-management-3.7.0 spec/support/json_responses.rb
contentful-management-3.6.0 spec/support/json_responses.rb
contentful-management-3.5.0 spec/support/json_responses.rb
contentful-management-3.4.0 spec/support/json_responses.rb
contentful-management-3.3.0 spec/support/json_responses.rb
contentful-management-3.2.0 spec/support/json_responses.rb
contentful-management-3.1.0 spec/support/json_responses.rb
contentful-2.16.0 spec/support/json_responses.rb
contentful-management-3.0.0 spec/support/json_responses.rb
contentful-management-2.13.1 spec/support/json_responses.rb
contentful-management-2.13.0 spec/support/json_responses.rb
contentful-management-2.12.1 spec/support/json_responses.rb
contentful-2.15.4 spec/support/json_responses.rb
contentful-2.15.3 spec/support/json_responses.rb
contentful-management-2.12.0 spec/support/json_responses.rb
contentful-2.15.2 spec/support/json_responses.rb
contentful-2.15.1 spec/support/json_responses.rb