mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #16094 from zuhao/refactor_activerecord_belongs_to_associations_test
Include fixtures to prevent foreign key violation.
This commit is contained in:
commit
6f8cc2eb14
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue