aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2014-08-28 15:30:29 +0900
committerAkira Matsuda <ronnie@dio.jp>2014-08-28 15:30:29 +0900
commit9489b212eb1e9bc3972f968a4d0213390db853a9 (patch)
treecee8afc584cb45b3fd314828d0ffecac726991aa /activerecord
parent4ded1311810312fe6614a28b93d7859fb854b23a (diff)
downloadrails-9489b212eb1e9bc3972f968a4d0213390db853a9.tar.gz
rails-9489b212eb1e9bc3972f968a4d0213390db853a9.tar.bz2
rails-9489b212eb1e9bc3972f968a4d0213390db853a9.zip
Be sure that test fixtures satisfy referential integrity before calculating
There exists some other test files that load :minivans fixtures but don't load :speedometers. Loading :speedometers here prevents the following error when this test was run after such test: CalculationsTest#test_should_group_by_association_with_non_numeric_foreign_key: ActiveRecord::RecordNotFound: Couldn't find all Speedometers with 'speedometer_id': (ABC, s1) (found 1 results, but was looking for 2)
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/calculations_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/calculations_test.rb b/activerecord/test/cases/calculations_test.rb
index 319ea9260a..06a196711c 100644
--- a/activerecord/test/cases/calculations_test.rb
+++ b/activerecord/test/cases/calculations_test.rb
@@ -22,7 +22,7 @@ class NumericData < ActiveRecord::Base
end
class CalculationsTest < ActiveRecord::TestCase
- fixtures :companies, :accounts, :topics
+ fixtures :companies, :accounts, :topics, :speedometers, :minivans
def test_should_sum_field
assert_equal 318, Account.sum(:credit_limit)