Sha256: 1319262e390a35635859f4ff573ae6b2d081badf86f0ba7d281f4905b84ae8bb
Contents?: true
Size: 830 Bytes
Versions: 1
Compression:
Stored size: 830 Bytes
Contents
require File.expand_path("../../test_helper", File.dirname(__FILE__)) class PaginationHelperTest < ActionView::TestCase include Paginary::Helpers::PaginationHelper delegate :params, :to => :controller def url_options { :controller => "widgets", :action => "index" } end def setup @klass = Widget @relation = @klass.unscoped end # Pagination =============================================================== test "paginate should yield page builder" do builder = nil paginate(@relation) { |b| builder = b } assert_kind_of Paginary::Helpers::PageBuilder, builder end test "paginate should query database for total number of items only once" do num = count_queries do paginate(@relation) { |page| page.links; page.items.to_a } end assert_equal 2, num end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
paginary-0.0.1.pre1 | test/unit/helpers/pagination_helper_test.rb |