aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-08 13:13:54 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-08 13:13:54 -0300
commit6f8cc2eb14f84b6895b555f6020289a029cf33ee (patch)
treefb38513352e1fd61e5cc4ba522592d80e3950909 /activerecord/test
parent84b9cc0a2bdb4aa20a6ecf6cc9344efa779e2139 (diff)
parenta843d54dd22e789642ac666452b92428c217bc07 (diff)
downloadrails-6f8cc2eb14f84b6895b555f6020289a029cf33ee.tar.gz
rails-6f8cc2eb14f84b6895b555f6020289a029cf33ee.tar.bz2
rails-6f8cc2eb14f84b6895b555f6020289a029cf33ee.zip
Merge pull request #16094 from zuhao/refactor_activerecord_belongs_to_associations_test
Include fixtures to prevent foreign key violation.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb2
1 files changed, 2 insertions, 0 deletions
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