aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/calculations_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-02-03 18:25:37 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-02-03 18:40:22 -0800
commit278186534c0ccf285a20497461f40d2e54aa20a0 (patch)
treeeb39e80e8e02fa6f7e04d7803efc1fccda63d3a4 /activerecord/test/cases/calculations_test.rb
parent34a37ea9e8265972a93f0c4f62e44308c27751dd (diff)
downloadrails-278186534c0ccf285a20497461f40d2e54aa20a0.tar.gz
rails-278186534c0ccf285a20497461f40d2e54aa20a0.tar.bz2
rails-278186534c0ccf285a20497461f40d2e54aa20a0.zip
Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha.
Diffstat (limited to 'activerecord/test/cases/calculations_test.rb')
-rw-r--r--activerecord/test/cases/calculations_test.rb36
1 files changed, 17 insertions, 19 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index 080f6a7007..5a4ed429b6 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -156,25 +156,23 @@ class CalculationsTest < ActiveRecord::TestCase
assert_equal 1, c[companies(:first_client)]
end
- uses_mocha 'group_by_non_numeric_foreign_key_association' do
- def test_should_group_by_association_with_non_numeric_foreign_key
- ActiveRecord::Base.connection.expects(:select_all).returns([{"count_all" => 1, "firm_id" => "ABC"}])
-
- firm = mock()
- firm.expects(:id).returns("ABC")
- firm.expects(:class).returns(Firm)
- Company.expects(:find).with(["ABC"]).returns([firm])
-
- column = mock()
- column.expects(:name).at_least_once.returns(:firm_id)
- column.expects(:type_cast).with("ABC").returns("ABC")
- Account.expects(:columns).at_least_once.returns([column])
-
- c = Account.count(:all, :group => :firm)
- first_key = c.keys.first
- assert_equal Firm, first_key.class
- assert_equal 1, c[first_key]
- end
+ def test_should_group_by_association_with_non_numeric_foreign_key
+ ActiveRecord::Base.connection.expects(:select_all).returns([{"count_all" => 1, "firm_id" => "ABC"}])
+
+ firm = mock()
+ firm.expects(:id).returns("ABC")
+ firm.expects(:class).returns(Firm)
+ Company.expects(:find).with(["ABC"]).returns([firm])
+
+ column = mock()
+ column.expects(:name).at_least_once.returns(:firm_id)
+ column.expects(:type_cast).with("ABC").returns("ABC")
+ Account.expects(:columns).at_least_once.returns([column])
+
+ c = Account.count(:all, :group => :firm)
+ first_key = c.keys.first
+ assert_equal Firm, first_key.class
+ assert_equal 1, c[first_key]
end
def test_should_calculate_grouped_association_with_foreign_key_option