Sha256: 4495dcc98834f55bf61e9341d0b84b87512c8d53736a7a66067862230462b565

Contents?: true

Size: 678 Bytes

Versions: 9

Compression:

Stored size: 678 Bytes

Contents

# :nodoc: all

require "test/unit"

require "glue/logger"

require "og"
require "nitro/ui/pager"

class RequestMock < Hash
	attr_accessor :query
	
	def initialize
		@query = {}
	end
	
	def get(k, default)
		return self[k] || default
	end
end

class TC_N_UI_Pager < Test::Unit::TestCase

	def setup
	end

	def teardown
#		$og.shutdown()
	end

	def test_all
		items = [1, 2, 3, 4, 5, 6, 7, 8, 9]
		count = items.size()
		
		request = RequestMock.new()
		pager = N::UI::Pager.new("tst", request, 2, items)
		
		assert_equal(pager.total_count, count)
		
		# bug: bad rounding.
		
		assert_equal(5, pager.page_count)
		
		# bug: FIXME
		# assert_equal(2, items.size())
		
	end
	
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nitro-0.10.0 test/nitro/ui/tc_pager.rb
nitro-0.11.0 test/nitro/ui/tc_pager.rb
nitro-0.12.0 test/nitro/ui/tc_pager.rb
nitro-0.13.0 test/nitro/ui/tc_pager.rb
nitro-0.14.0 test/nitro/ui/tc_pager.rb
nitro-0.15.0 test/nitro/ui/tc_pager.rb
nitro-0.8.0 test/nitro/ui/tc_pager.rb
nitro-0.9.3 test/nitro/ui/tc_pager.rb
nitro-0.9.5 test/nitro/ui/tc_pager.rb