From 9ccb12a3dda123942def21834eedb761299f67b9 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 14 Jan 2007 16:19:58 +0000 Subject: Test that calculations don't modify their options hash. References #6929. [eventualbuddha] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5931 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/calculations_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/calculations_test.rb b/activerecord/test/calculations_test.rb index 23c45f8637..e450c0a917 100644 --- a/activerecord/test/calculations_test.rb +++ b/activerecord/test/calculations_test.rb @@ -131,6 +131,14 @@ class CalculationsTest < Test::Unit::TestCase assert_equal 2, c[companies(:rails_core)] assert_equal 1, c[companies(:first_client)] end + + def test_should_not_modify_options_when_using_includes + options = {:conditions => 'companies.id > 1', :include => :firm} + options_copy = options.dup + + Account.count(:all, options) + assert_equal options_copy, options + end def test_should_calculate_grouped_by_function c = Company.count(:all, :group => "UPPER(#{QUOTED_TYPE})") -- cgit v1.2.3