Skip to content

Commit aa4cd10

Browse files
committed
Make sure count works too.
1 parent da2131d commit aa4cd10

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/cases/offset_and_limit_test_sqlserver.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ class OffsetAndLimitTestSqlserver < ActiveRecord::TestCase
8787
# Mary has duplicate categorizations to the thinking post.
8888
assert_equal [thinking, thinking], mary.categorized_posts.all
8989
assert_equal [thinking], mary.unique_categorized_posts.limit(2).offset(0)
90-
# Paging thru David's uniq ordered comments.
90+
# Paging thru David's uniq ordered comments, with count too.
9191
assert_equal [1, 2, 3, 5, 6, 7, 8, 9, 10, 12], david.ordered_uniq_comments.map(&:id)
9292
assert_equal [3, 5], david.ordered_uniq_comments.limit(2).offset(2).map(&:id)
93-
assert_equal [7, 8, 9, 10, 12], david.ordered_uniq_comments.limit(5).offset(5).map(&:id)
93+
assert_equal 2, david.ordered_uniq_comments.limit(2).offset(2).count
94+
assert_equal [8, 9, 10, 12], david.ordered_uniq_comments.limit(5).offset(6).map(&:id)
95+
assert_equal 4, david.ordered_uniq_comments.limit(5).offset(6).count
9496
end
9597

9698
context 'with count' do

0 commit comments

Comments
 (0)