From 4cf4ea506def9a3e36cc90a2b0e073cbb8fc43df Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Sun, 28 Jul 2013 16:51:55 +0530 Subject: make test not depend on order `NestedThroughAssociationsTest` adds records to `member_details` table. When test performs `@member_details[0]` then the order of record is not guaranteed. Hence it is best to start with a clean slate by deleting unwanted records. --- .../test/cases/associations/has_one_through_associations_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/activerecord/test/cases/associations/has_one_through_associations_test.rb b/activerecord/test/cases/associations/has_one_through_associations_test.rb index 90c557e886..01a4137a5d 100644 --- a/activerecord/test/cases/associations/has_one_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_one_through_associations_test.rb @@ -191,6 +191,7 @@ class HasOneThroughAssociationsTest < ActiveRecord::TestCase end def test_preloading_has_one_through_on_belongs_to + MemberDetail.delete_all assert_not_nil @member.member_type @organization = organizations(:nsa) @member_detail = MemberDetail.new -- cgit v1.2.3