Sha256: ceea2d31b8a60e4ea571d0b22c81d14d6639143198469feba0c294d8014f7aef

Contents?: true

Size: 573 Bytes

Versions: 55

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

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) }

  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
      expect(pagination.pages_left).to eq(9)
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
lhs-26.2.0 spec/pagination/offset/pages_left_spec.rb
lhs-26.1.0 spec/pagination/offset/pages_left_spec.rb
lhs-26.0.1 spec/pagination/offset/pages_left_spec.rb
lhs-26.0.0 spec/pagination/offset/pages_left_spec.rb
lhs-25.2.0 spec/pagination/offset/pages_left_spec.rb
lhs-25.1.0 spec/pagination/offset/pages_left_spec.rb
lhs-25.0.4 spec/pagination/offset/pages_left_spec.rb
lhs-25.0.3 spec/pagination/offset/pages_left_spec.rb
lhs-25.0.2 spec/pagination/offset/pages_left_spec.rb
lhs-25.0.1 spec/pagination/offset/pages_left_spec.rb
lhs-25.0.0 spec/pagination/offset/pages_left_spec.rb
lhs-24.1.2 spec/pagination/offset/pages_left_spec.rb
lhs-24.1.1 spec/pagination/offset/pages_left_spec.rb
lhs-24.1.0 spec/pagination/offset/pages_left_spec.rb
lhs-24.1.0.pre.2 spec/pagination/offset/pages_left_spec.rb
lhs-24.1.0.pre.1 spec/pagination/offset/pages_left_spec.rb
lhs-24.0.0 spec/pagination/offset/pages_left_spec.rb
lhs-23.0.2 spec/pagination/offset/pages_left_spec.rb
lhs-23.0.1 spec/pagination/offset/pages_left_spec.rb
lhs-23.0.0 spec/pagination/offset/pages_left_spec.rb