Permalink
Browse files

Make to not return query chain - test case

  • Loading branch information...
1 parent 9561094 commit 851cc1c2b6516e5013919df14d0614f56d594a72 @knapo committed May 25, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 activerecord/test/cases/batches_test.rb
@@ -18,6 +18,13 @@ def test_each_should_excecute_one_query_per_batch
end
end
+ def test_each_should_not_return_query_chain_and_excecute_only_one_query
+ assert_queries(1) do
+ result = Post.find_each(:batch_size => 100000){ }
+ assert_nil result
+ end
+ end
+
def test_each_should_raise_if_select_is_set_without_id
assert_raise(RuntimeError) do
Post.find_each(:select => :title, :batch_size => 1) { |post| post }

0 comments on commit 851cc1c

Please sign in to comment.