Sha256: 88eb1a5b20222a0a8233376b70a9c6c84981c9bbf801dfe4d0409e50bf0b906e

Contents?: true

Size: 716 Bytes

Versions: 1

Compression:

Stored size: 716 Bytes

Contents

require 'test_helper'

class RelationEmptyTest < ActiveSupport::TestCase

  setup do
    @relation = Model.page(1).per(2)
  end

  test "should have 1 page" do
    assert_equal @relation.total_pages, 1
  end

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

  test "first page should be 1" do
    assert_equal @relation.first_page, 1
  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 @relation.last_page, 1
  end

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

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pageable-2.1.0 test/empty_test.rb