Skip to content

Commit e739fba

Browse files
committed
Coerce new test introduced in activerecord 3.0.7.rc1.
1 parent 0e9cd8b commit e739fba

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require 'cases/sqlserver_helper'
2+
require 'models/post'
3+
4+
class BatchesTestSqlserver < ActiveRecord::TestCase
5+
end
6+
7+
class EachTest < ActiveRecord::TestCase
8+
9+
COERCED_TESTS = [
10+
:test_find_in_batches_should_quote_batch_order
11+
]
12+
13+
include SqlserverCoercedTest
14+
15+
fixtures :posts
16+
17+
def test_coerced_find_in_batches_should_quote_batch_order
18+
c = Post.connection
19+
assert_sql(/ORDER BY \[posts\]\.\[id\]/) do
20+
Post.find_in_batches(:batch_size => 1) do |batch|
21+
assert_kind_of Array, batch
22+
assert_kind_of Post, batch.first
23+
end
24+
end
25+
end
26+
27+
28+
end

0 commit comments

Comments
 (0)