From a843d54dd22e789642ac666452b92428c217bc07 Mon Sep 17 00:00:00 2001 From: Zuhao Wan Date: Wed, 9 Jul 2014 00:04:14 +0800 Subject: [PATCH] Include fixtures to prevent foreign key violation. --- .../test/cases/associations/belongs_to_associations_test.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index c9bdfb88ae..25555bd75c 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -937,6 +937,8 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase end class BelongsToWithForeignKeyTest < ActiveRecord::TestCase + fixtures :authors, :author_addresses + def test_destroy_linked_models address = AuthorAddress.create! author = Author.create! name: "Author", author_address_id: address.id