Permalink
Browse files

Add test for issue #161

  • Loading branch information...
1 parent 48171e6 commit eb8461f0c047dab219e0895a2a836249ec4e1ccc @metaskills metaskills committed May 5, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 test/cases/offset_and_limit_test_sqlserver.rb
@@ -64,6 +64,11 @@ class OffsetAndLimitTestSqlserver < ActiveRecord::TestCase
assert_sql(pattern) { Book.count :limit => 3, :offset => 5, :lock => 'WITH (NOLOCK)' }
end
+ should 'have valid sort order' do
+ order_row_numbers = SqlServerOrderRowNumber.offset(7).order("c DESC").select("c, ROW_NUMBER() OVER (ORDER BY c ASC) AS [dummy]").all.map(&:c)
+ assert_equal [2, 1, 0], order_row_numbers
+ end
+
context 'with count' do
should 'pass a gauntlet of window tests' do

0 comments on commit eb8461f

Please sign in to comment.