File: find_in_batches_test.rb

package info (click to toggle)
ruby-activerecord-deprecated-finders 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 188 kB
  • ctags: 94
  • sloc: ruby: 1,026; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'helper'

describe 'find_in_batches' do
  after do
    Post.destroy_all
  end

  it 'accepts finder options' do
    foo = Post.create title: 'foo'
    Post.create title: 'bar'

    assert_deprecated do
      Post.find_in_batches(conditions: "title = 'foo'") do |records|
        records.must_equal [foo]
      end
    end
  end
end