Sha256: 4fe64fc271b31c09d48c3a6a84029db30f30ea19349dbefb00482c3bb63b0827

Contents?: true

Size: 623 Bytes

Versions: 52

Compression:

Stored size: 623 Bytes

Contents

require 'rails_helper'

describe LHS::Record do
  let(:datastore) do
    'http://datastore/v2'
  end

  before(:each) do
    LHC.config.placeholder('datastore', datastore)
    class Record < LHS::Record
      endpoint ':datastore/feedbacks'
    end
  end

  context 'all' do
    it 'is querying endpoint without pagination when using all' do
      stub_request(:get, "#{datastore}/feedbacks?limit=100").to_return(status: 200, body: { items: 300.times.map { { foo: 'bar' } }, total: 300 }.to_json)
      records = Record.all
      expect(records).to be_kind_of Record
      expect(records.size).to eq(300)
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
lhs-8.0.0 spec/record/all_spec.rb
lhs-7.4.1 spec/record/all_spec.rb
lhs-7.4.0 spec/record/all_spec.rb
lhs-7.3.0 spec/record/all_spec.rb
lhs-7.2.5 spec/record/all_spec.rb
lhs-7.2.4 spec/record/all_spec.rb
lhs-7.2.3 spec/record/all_spec.rb
lhs-7.2.2 spec/record/all_spec.rb
lhs-7.2.1 spec/record/all_spec.rb
lhs-7.2.0 spec/record/all_spec.rb
lhs-7.1.0 spec/record/all_spec.rb
lhs-7.0.3 spec/record/all_spec.rb
lhs-7.0.2 spec/record/all_spec.rb
lhs-7.0.1 spec/record/all_spec.rb
lhs-7.0.0 spec/record/all_spec.rb
lhs-6.8.2 spec/record/all_spec.rb
lhs-6.8.1 spec/record/all_spec.rb
lhs-6.8.0 spec/record/all_spec.rb
lhs-6.7.2 spec/record/all_spec.rb
lhs-6.7.1 spec/record/all_spec.rb