Sha256: f7ca3ffd54993acc40c88a39f91ec1facc07f15b09854aa8b9b8085e61979c22

Contents?: true

Size: 582 Bytes

Versions: 12

Compression:

Stored size: 582 Bytes

Contents

module FixtureHelpers

  def stub_api_request(endpoint, options = {})
    options = {
      :method => :get,
      :status => 200,
      :api_version => '24.0',
      :with => nil
    }.merge(options)

    stub = stub_request(options[:method], %r{/services/data/v#{options[:api_version]}/#{endpoint}})
    stub = stub.with(:body => options[:body]) if options[:body]
    stub = stub.to_return(:status => options[:status], :body => options[:with] ? fixture(options[:with]) : '')
  end

  def fixture(f)
    File.read(File.expand_path("../../fixtures/#{f}.json", __FILE__))
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
restforce-0.1.3 spec/support/fixture_helpers.rb
restforce-0.1.2 spec/support/fixture_helpers.rb
restforce-0.1.1 spec/support/fixture_helpers.rb
restforce-0.1.0 spec/support/fixture_helpers.rb
restforce-0.0.8 spec/support/fixture_helpers.rb
restforce-0.0.7 spec/support/fixture_helpers.rb
restforce-0.0.6 spec/support/fixture_helpers.rb
restforce-0.0.5 spec/support/fixture_helpers.rb
restforce-0.0.4 spec/support/fixture_helpers.rb
restforce-0.0.3 spec/support/fixture_helpers.rb
restforce-0.0.2 spec/support/fixture_helpers.rb
restforce-0.0.1 spec/support/fixture_helpers.rb