mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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)
This commit is contained in:
parent
4ded131181
commit
9489b212eb
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue