Sha256: 873b11fbbd95c58a7c2b12f49a47c9b67d0007b85e16aa4272768fc980f03d88

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

require 'test_helper'
require 'geared_pagination/ratios'

class GearedPagination::RatiosTest < ActiveSupport::TestCase
  test "single limit" do
    limits = GearedPagination::Ratios.new(10)

    assert_equal 10, limits[1]
    assert_equal 10, limits[2]
  end

  test "range of limits" do
    limits = GearedPagination::Ratios.new([ 10, 25, 100 ])

    assert_equal 10, limits[1]
    assert_equal 25, limits[2]
    assert_equal 100, limits[3]
    assert_equal 100, limits[4]
  end

  test "default limits" do
    limits = GearedPagination::Ratios.new

    assert_equal GearedPagination::Ratios::DEFAULTS.first, limits[1]
    assert_equal GearedPagination::Ratios::DEFAULTS.last, limits[99]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geared_pagination-0.1 test/ratios_test.rb