Sha256: 09b639821aeedbadb2fd20896274242c836d2f7a6aa14cefb67c56faa66d748f
Contents?: true
Size: 709 Bytes
Versions: 43
Compression:
Stored size: 709 Bytes
Contents
require 'rails_helper' describe LHS::Record do let(:offset) { 0 } let(:data_hash) { { items: 98.times.map { { foo: 'bar' } }, total: 98, offset: offset, limit: 10 } } let(:data) do LHS::Data.new(data_hash, nil, Record) end let(:pagination) { LHS::OffsetPagination.new(data) } before(:each) do class Record < LHS::Record endpoint ':datastore/v2/data' end end it 'responds to pages_left' do expect(pagination.pages_left).to eq(9) end context 'when there is no offset' do let(:offset) { nil } it 'responds to pages_left' do # TODO i now set the nil offset to zero. Is this ok or wrong? expect(pagination.pages_left).to eq(9) end end end
Version data entries
43 entries across 43 versions & 1 rubygems