1 require 'abstract_unit'
\r
2 require 'fixtures/reference_type'
\r
3 require 'fixtures/reference_code'
\r
4 require 'plugins/pagination'
\r
6 class TestPagination < Test::Unit::TestCase
\r
7 fixtures :reference_types, :reference_codes
\r
9 include ActionController::Pagination
\r
10 DEFAULT_PAGE_SIZE = 2
\r
12 attr_accessor :params
\r
16 :class => ReferenceType,
\r
17 :primary_keys => :reference_type_id,
\r
18 :table => :reference_types,
\r
21 :class => ReferenceCode,
\r
22 :primary_keys => [:reference_type_id, :reference_code],
\r
23 :table => :reference_codes,
\r
28 self.class.classes = CLASSES
\r
32 def test_paginate_all
\r
34 @object_pages, @objects = paginate @klass_info[:table], :per_page => DEFAULT_PAGE_SIZE
\r
35 assert_equal 2, @objects.length, "Each page should have #{DEFAULT_PAGE_SIZE} items"
\r