diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-28 16:51:55 +0530 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2013-07-28 16:51:55 +0530 |
commit | 4cf4ea506def9a3e36cc90a2b0e073cbb8fc43df (patch) | |
tree | c4ed6ebc8f1b5c0684ce9c2277d4d5dba0b480d4 | |
parent | bffda1e65e41c77c6c7fc8053feee6dddd0900ef (diff) | |
download | rails-4cf4ea506def9a3e36cc90a2b0e073cbb8fc43df.tar.gz rails-4cf4ea506def9a3e36cc90a2b0e073cbb8fc43df.tar.bz2 rails-4cf4ea506def9a3e36cc90a2b0e073cbb8fc43df.zip |
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.
-rw-r--r-- | activerecord/test/cases/associations/has_one_through_associations_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |