From 3f596f8ad37bcebbccbc51ee0190d2949abdc69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 27 Jun 2014 17:32:38 -0300 Subject: Do not change the global state of the test suite --- .../associations/belongs_to_associations_test.rb | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'activerecord/test/cases/associations/belongs_to_associations_test.rb') diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index 1a0f447ec2..4238681905 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -938,26 +938,9 @@ end unless current_adapter?(:MysqlAdapter, :Mysql2Adapter) class BelongsToWithForeignKeyTest < ActiveRecord::TestCase - setup do - @connection = ActiveRecord::Base.connection - @connection.create_table :author_addresses, force: true - - @connection.create_table :authors, force: true do |t| - t.string :name - t.references :author_address - end - - @connection.add_foreign_key :authors, :author_address - end - - teardown do - @connection.drop_table :authors, if_exists: true - @connection.drop_table :author_addresses, if_exists: true - end - def test_destroy_linked_models address = AuthorAddress.create! - author = Author.create! id: 1, name: "Author", author_address_id: address.id + author = Author.create! name: "Author", author_address_id: address.id author.destroy! end -- cgit v1.2.3