File: calculate_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 (15 lines) | stat: -rw-r--r-- 315 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'helper'

describe 'calculate' do
  after do
    Post.destroy_all
  end

  it 'supports finder options' do
    Post.create id: 1
    Post.create id: 2, title: 'foo'
    Post.create id: 3, title: 'foo'

    assert_deprecated { Post.calculate(:sum, :id, conditions: { title: 'foo' }) }.must_equal 5
  end
end