2 require 'models/entrant'
4 class DeprecatedFinderTest
< ActiveRecord
::TestCase
7 def test_deprecated_find_all_was_removed
8 assert_raise(NoMethodError
) { Entrant
.find_all
}
11 def test_deprecated_find_first_was_removed
12 assert_raise(NoMethodError
) { Entrant
.find_first
}
15 def test_deprecated_find_on_conditions_was_removed
16 assert_raise(NoMethodError
) { Entrant
.find_on_conditions
}
20 assert_equal(0, Entrant
.count(:conditions => "id > 3"))
21 assert_equal(1, Entrant
.count(:conditions => ["id > ?", 2]))
22 assert_equal(2, Entrant
.count(:conditions => ["id > ?", 1]))
26 assert_equal(0, Entrant
.count_by_sql("SELECT COUNT(*) FROM entrants WHERE id > 3"))
27 assert_equal(1, Entrant
.count_by_sql(["SELECT COUNT(*) FROM entrants WHERE id > ?", 2]))
28 assert_equal(2, Entrant
.count_by_sql(["SELECT COUNT(*) FROM entrants WHERE id > ?", 1]))