1
0
Fork 0
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:
Rafael Mendonça França 2014-07-08 13:13:54 -03:00
commit 6f8cc2eb14

View file

@ -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