Sha256: d926c1c623cb2920240b96e193991fb69c5e835607ffcaeaf59925a115e60477

Contents?: true

Size: 725 Bytes

Versions: 1

Compression:

Stored size: 725 Bytes

Contents

require 'test_helper'

class EmptyTest < ActiveSupport::TestCase
 
  test 'should have 1 page' do
    assert_equal 1, relation.total_pages
  end

  test 'current page should be 1' do
    assert_equal 1, relation.current_page
  end

  test 'first page should be 1' do
    assert_equal 1, relation.first_page
  end

  test 'should have no previous page' do
    assert_nil relation.previous_page
  end

  test 'should have no next page' do
    assert_nil relation.next_page
  end
 
  test 'last page should be 1' do
    assert_equal 1, relation.last_page
  end

  test 'should not be out of bounds' do
    assert !relation.out_of_bounds?
  end

  protected

  def relation
    @relation ||= Record.page(1, length: 2)
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pagers-3.1.0 test/empty_test.rb