aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-03-07 11:35:00 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-03-07 11:35:00 +0900
commitcece9ea0cde831f83b46e7c1181125cd3f400f67 (patch)
treefdf773abcbf64a46e670402f709c0cf7f6ec7d82 /activerecord/test/cases
parent1aece76e2548672e5a56c1459c0c1a150ea4f175 (diff)
downloadrails-cece9ea0cde831f83b46e7c1181125cd3f400f67.tar.gz
rails-cece9ea0cde831f83b46e7c1181125cd3f400f67.tar.bz2
rails-cece9ea0cde831f83b46e7c1181125cd3f400f67.zip
Just inherit `ForeignKeyChangeColumnTest` for with prefix/suffix tests
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/migration/foreign_key_test.rb22
1 files changed, 5 insertions, 17 deletions
diff --git a/activerecord/test/cases/migration/foreign_key_test.rb b/activerecord/test/cases/migration/foreign_key_test.rb
index da82f62406..ba21923d79 100644
--- a/activerecord/test/cases/migration/foreign_key_test.rb
+++ b/activerecord/test/cases/migration/foreign_key_test.rb
@@ -20,7 +20,9 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
end
end
- module ForeignKeyChangeColumnSharedTest
+ class ForeignKeyChangeColumnTest < ActiveRecord::TestCase
+ self.use_transactional_tests = false
+
class Rocket < ActiveRecord::Base
has_many :astronauts
end
@@ -141,17 +143,7 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
end
end
- class ForeignKeyChangeColumnTest < ActiveRecord::TestCase
- include ForeignKeyChangeColumnSharedTest
-
- self.use_transactional_tests = false
- end
-
- class ForeignKeyChangeColumnWithPrefixTest < ActiveRecord::TestCase
- include ForeignKeyChangeColumnSharedTest
-
- self.use_transactional_tests = false
-
+ class ForeignKeyChangeColumnWithPrefixTest < ForeignKeyChangeColumnTest
setup do
ActiveRecord::Base.table_name_prefix = "p_"
end
@@ -161,11 +153,7 @@ if ActiveRecord::Base.connection.supports_foreign_keys?
end
end
- class ForeignKeyChangeColumnWithSuffixTest < ActiveRecord::TestCase
- include ForeignKeyChangeColumnSharedTest
-
- self.use_transactional_tests = false
-
+ class ForeignKeyChangeColumnWithSuffixTest < ForeignKeyChangeColumnTest
setup do
ActiveRecord::Base.table_name_suffix = "_p"
end