Sha256: 9ac27ea3d4556fabd1fa41e4666479c58caeaec2c1e290abdf993f5088337205

Contents?: true

Size: 553 Bytes

Versions: 5

Compression:

Stored size: 553 Bytes

Contents

require 'test_helper'

class PaddingTest < ActiveSupport::TestCase
 
  test 'total pages with padding' do
    19.times.each { |index| Record.create }

    relation = Record.page(1, length: 15, padding: 4)
    assert_equal 15, relation.size
    assert_equal 1, relation.total_pages
 
    relation = Record.page(2, length: 15, padding: 4)
    assert_equal 0, relation.size
    assert_equal 1, relation.total_pages

    relation = Record.page(3, length: 15, padding: 4)
    assert_equal 0, relation.size
    assert_equal 1, relation.total_pages
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pagers-3.1.5 test/padding_test.rb
pagers-3.1.4 test/padding_test.rb
pagers-3.1.3 test/padding_test.rb
pagers-3.1.2 test/padding_test.rb
pagers-3.1.1 test/padding_test.rb