Permalink
Browse files

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
  • Loading branch information...
1 parent 0227f86 commit 9ccb12a3dda123942def21834eedb761299f67b9 @jeremy jeremy committed Jan 14, 2007
Showing with 8 additions and 0 deletions.
  1. +8 −0 activerecord/test/calculations_test.rb
View
8 activerecord/test/calculations_test.rb
@@ -131,6 +131,14 @@ def test_should_calculate_grouped_association_with_invalid_field
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})")

0 comments on commit 9ccb12a

Please sign in to comment.