Sha256: b6c0346dd361a86a493195e79ab1d5bd9dc1e9012dd418fe82b7d4f733a8085b

Contents?: true

Size: 619 Bytes

Versions: 8

Compression:

Stored size: 619 Bytes

Contents

module RestfullAccessibleStub
  def stub_get_request(url, resource_name)
    stub_request(:get, url)
      .with(
        headers: request_headers
      ).to_return(
        status: 200,
        body: %Q[{#{resource_name}: "dummy"}]
      )
  end

  def stub_get_request_not_found(url)
    stub_request(:get, url)
      .with(
        headers: request_headers
      ).to_return(
        status: 404,
        body: "itemNotFound"
      )
  end

  def request_headers
    {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>"Faraday v#{Faraday::VERSION}"}
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yao-0.8.0 test/support/restfully_accesible_stub.rb
yao-0.7.0 test/support/restfully_accesible_stub.rb
yao-0.6.3 test/support/restfully_accesible_stub.rb
yao-0.6.2 test/support/restfully_accesible_stub.rb
yao-0.6.1 test/support/restfully_accesible_stub.rb
yao-0.6.0 test/support/restfully_accesible_stub.rb
yao-0.5.0 test/support/restfully_accesible_stub.rb
yao-0.4.3 test/support/restfully_accesible_stub.rb