1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

test refactor, don't hardcode default for table_name_prefix.

This commit is contained in:
Yves Senn 2014-06-06 15:47:57 +02:00
parent 89845ff866
commit d23cbbb3ee

View file

@ -34,6 +34,7 @@ if ActiveRecord::Base.connection.supports_migrations?
def test_schema_define_w_table_name_prefix def test_schema_define_w_table_name_prefix
table_name = ActiveRecord::SchemaMigration.table_name table_name = ActiveRecord::SchemaMigration.table_name
old_table_name_prefix = ActiveRecord::Base.table_name_prefix
ActiveRecord::Base.table_name_prefix = "nep_" ActiveRecord::Base.table_name_prefix = "nep_"
ActiveRecord::SchemaMigration.table_name = "nep_#{table_name}" ActiveRecord::SchemaMigration.table_name = "nep_#{table_name}"
ActiveRecord::Schema.define(:version => 7) do ActiveRecord::Schema.define(:version => 7) do
@ -46,7 +47,7 @@ if ActiveRecord::Base.connection.supports_migrations?
end end
assert_equal 7, ActiveRecord::Migrator::current_version assert_equal 7, ActiveRecord::Migrator::current_version
ensure ensure
ActiveRecord::Base.table_name_prefix = "" ActiveRecord::Base.table_name_prefix = old_table_name_prefix
ActiveRecord::SchemaMigration.table_name = table_name ActiveRecord::SchemaMigration.table_name = table_name
end end