X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F67pager.t;h=6a6aabc60d1c44e7b7414dcb3670be83ecfd0f07;hb=497d874ac78f5b6bba1309001f62c299a9419499;hp=b7bb73f480bab1712492f7fe93d12f3f894250f0;hpb=e6c747fd70a279e5b97392a266635672f39f7a30;p=dbsrgits%2FDBIx-Class.git diff --git a/t/67pager.t b/t/67pager.t index b7bb73f..6a6aabc 100644 --- a/t/67pager.t +++ b/t/67pager.t @@ -21,6 +21,8 @@ is( $it->pager->next_page, 2, "next_page ok" ); is( $it->count, 3, "count on paged rs ok" ); +is( $it->pager->total_entries, 5, "total_entries ok" ); + is( $it->next->title, "Caterwaulin' Blues", "iterator->next ok" ); $it->next; @@ -82,3 +84,19 @@ is($p->(), 10, 'default rows is 10'); $schema->default_resultset_attributes({ rows => 5 }); is($p->(), 5, 'default rows is 5'); + +# test page with offset +$it = $schema->resultset('CD')->search({}, { + rows => 2, + page => 2, + offset => 1, + order_by => 'cdid' +}); + +my $row = $schema->resultset('CD')->search({}, { + order_by => 'cdid', + offset => 3, + rows => 1 +})->single; + +is($row->cdid, $it->first->cdid, 'page with offset');