-require 'abstract_unit'\r
-require 'fixtures/reference_type'\r
-require 'fixtures/reference_code'\r
-require 'plugins/pagination'\r
-\r
-class TestPagination < Test::Unit::TestCase\r
- fixtures :reference_types, :reference_codes\r
- \r
- include ActionController::Pagination\r
- DEFAULT_PAGE_SIZE = 2\r
- \r
- attr_accessor :params\r
- \r
- CLASSES = {\r
- :single => {\r
- :class => ReferenceType,\r
- :primary_keys => :reference_type_id,\r
- :table => :reference_types,\r
- },\r
- :dual => { \r
- :class => ReferenceCode,\r
- :primary_keys => [:reference_type_id, :reference_code],\r
- :table => :reference_codes,\r
- },\r
- }\r
- \r
- def setup\r
- self.class.classes = CLASSES\r
- @params = {}\r
- end\r
-\r
- def test_paginate_all\r
- testing_with do\r
- @object_pages, @objects = paginate @klass_info[:table], :per_page => DEFAULT_PAGE_SIZE\r
- assert_equal 2, @objects.length, "Each page should have #{DEFAULT_PAGE_SIZE} items"\r
- end\r
- end\r
+require 'abstract_unit'
+require 'fixtures/reference_type'
+require 'fixtures/reference_code'
+require 'plugins/pagination'
+
+class TestPagination < Test::Unit::TestCase
+ fixtures :reference_types, :reference_codes
+
+ include ActionController::Pagination
+ DEFAULT_PAGE_SIZE = 2
+
+ attr_accessor :params
+
+ CLASSES = {
+ :single => {
+ :class => ReferenceType,
+ :primary_keys => :reference_type_id,
+ :table => :reference_types,
+ },
+ :dual => {
+ :class => ReferenceCode,
+ :primary_keys => [:reference_type_id, :reference_code],
+ :table => :reference_codes,
+ },
+ }
+
+ def setup
+ self.class.classes = CLASSES
+ @params = {}
+ end
+
+ def test_paginate_all
+ testing_with do
+ @object_pages, @objects = paginate @klass_info[:table], :per_page => DEFAULT_PAGE_SIZE
+ assert_equal 2, @objects.length, "Each page should have #{DEFAULT_PAGE_SIZE} items"
+ end
+ end
end
\ No newline at end of file