aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/calculations_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-13 18:26:04 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-13 18:26:19 +0100
commit1ad138cf4b5c164c830917e5d4ef25943373bd0b (patch)
tree0427bc4f83851ede310261098651102237a4a4a2 /activerecord/test/cases/calculations_test.rb
parent012bab8c9f0e9a9208e32ef57c8dd5c7e1c2f115 (diff)
downloadrails-1ad138cf4b5c164c830917e5d4ef25943373bd0b.tar.gz
rails-1ad138cf4b5c164c830917e5d4ef25943373bd0b.tar.bz2
rails-1ad138cf4b5c164c830917e5d4ef25943373bd0b.zip
fix tests
Diffstat (limited to 'activerecord/test/cases/calculations_test.rb')
-rw-r--r--activerecord/test/cases/calculations_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index 0391319a00..48cb05e36e 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -49,12 +49,12 @@ class CalculationsTest < ActiveRecord::TestCase
end
def test_should_get_maximum_of_field_with_include
- assert_equal 55, Account.maximum(:credit_limit, :include => :firm, :references => :companies, :conditions => "companies.name != 'Summit'")
+ assert_equal 55, Account.where("companies.name != 'Summit'").references(:companies).includes(:firm).maximum(:credit_limit)
end
def test_should_get_maximum_of_field_with_scoped_include
- Account.send :with_scope, :find => { :include => :firm, :references => :companies, :conditions => "companies.name != 'Summit'" } do
- assert_equal 55, Account.maximum(:credit_limit)
+ Account.send :with_scope, :find => { :include => :firm } do
+ assert_equal 55, Account.where("companies.name != 'Summit'").references(:companies).maximum(:credit_limit)
end
end
@@ -270,10 +270,10 @@ class CalculationsTest < ActiveRecord::TestCase
end
def test_should_not_modify_options_when_using_includes
- options = {:conditions => 'companies.id > 1', :include => :firm, :references => :companies}
+ options = {:conditions => 'companies.id > 1', :include => :firm}
options_copy = options.dup
- Account.count(:all, options)
+ Account.references(:companies).count(:all, options)
assert_equal options_copy, options
end