Sha256: 6f13dbab8ab63d2ce302107be5fc0d5b665d14293b24d57f10f345287da02e55
Contents?: true
Size: 711 Bytes
Versions: 58
Compression:
Stored size: 711 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::Pagination::Offset.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
58 entries across 58 versions & 1 rubygems