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