diff options
Diffstat (limited to 'activerecord/test/calculations_test.rb')
-rw-r--r-- | activerecord/test/calculations_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/calculations_test.rb b/activerecord/test/calculations_test.rb index e450c0a917..22ef78ce40 100644 --- a/activerecord/test/calculations_test.rb +++ b/activerecord/test/calculations_test.rb @@ -4,6 +4,10 @@ require 'fixtures/topic' Company.has_many :accounts +class NumericData < ActiveRecord::Base + self.table_name = 'numeric_data' +end + class CalculationsTest < Test::Unit::TestCase fixtures :companies, :accounts, :topics @@ -17,6 +21,10 @@ class CalculationsTest < Test::Unit::TestCase assert_in_delta 53.0, value, 0.001 end + def test_should_return_nil_as_average + assert_nil NumericData.average(:bank_balance) + end + def test_should_get_maximum_of_field assert_equal 60, Account.maximum(:credit_limit) end |