diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-19 15:22:09 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-19 15:22:09 +0530 |
commit | b9599502c9e738a5a1513e75d08f8d40ed408265 (patch) | |
tree | afad18ebc168c3d3c511626255a58c7c306f95a5 /activerecord/test | |
parent | 71d67fc6bd504956bce66e274e6228dd00a814c1 (diff) | |
download | rails-b9599502c9e738a5a1513e75d08f8d40ed408265.tar.gz rails-b9599502c9e738a5a1513e75d08f8d40ed408265.tar.bz2 rails-b9599502c9e738a5a1513e75d08f8d40ed408265.zip |
Add Relation#construct_relation_for_association_calculations for calculations with includes
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/calculations_test.rb | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb index bd2d471fc7..c3b2e56387 100644 --- a/activerecord/test/cases/calculations_test.rb +++ b/activerecord/test/cases/calculations_test.rb @@ -246,23 +246,6 @@ class CalculationsTest < ActiveRecord::TestCase assert_equal 8, c['Jadedpixel'] end - def test_should_reject_invalid_options - assert_nothing_raised do - # empty options are valid - Company.send(:validate_calculation_options) - # these options are valid for all calculations - [:select, :conditions, :joins, :order, :group, :having, :distinct].each do |opt| - Company.send(:validate_calculation_options, opt => true) - end - - # :include is only valid on :count - Company.send(:validate_calculation_options, :include => true) - end - - assert_raise(ArgumentError) { Company.send(:validate_calculation_options, :sum, :foo => :bar) } - assert_raise(ArgumentError) { Company.send(:validate_calculation_options, :count, :foo => :bar) } - end - def test_should_count_selected_field_with_include assert_equal 6, Account.count(:distinct => true, :include => :firm) assert_equal 4, Account.count(:distinct => true, :include => :firm, :select => :credit_limit) |