Sha256: 9f39f9ea5bbbffef9494afc392165602ee615280a74ac94c9f015aea5c195110

Contents?: true

Size: 600 Bytes

Versions: 5

Compression:

Stored size: 600 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'
require 'lhs/rspec'

describe LHS do

  before do
    class Record < LHS::Record
      endpoint 'https://records'
    end

    LHS.stub.all(
      'https://records',
      200.times.map { |index| { name: "Item #{index}" } },
      headers: {
        'Authorization' => 'Bearer 123'
      }
    )
  end

  it 'stubs all requests' do
    records = Record.options(headers: { 'Authorization' => 'Bearer 123' }).all.fetch
    expect(records.count).to eq 200
    expect(records.length).to eq 200
    expect(records.first.name).to eq 'Item 0'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lhs-20.1.3.pre.paginationfix.3 spec/stubs/all_spec.rb
lhs-20.1.3.pre.paginationfix.2 spec/stubs/all_spec.rb
lhs-20.1.3.pre.paginationfix.1 spec/stubs/all_spec.rb
lhs-20.1.2 spec/stubs/all_spec.rb
lhs-20.1.1 spec/stubs/all_spec.rb