stop more ddl changes
This commit is contained in:
parent
86a73cd849
commit
21afd9b96d
|
@ -233,20 +233,6 @@ class MigrationTest < ActiveRecord::TestCase
|
|||
refute Person.column_methods_hash.include?(:last_name)
|
||||
end
|
||||
|
||||
def test_get_all_versions
|
||||
ActiveRecord::Migrator.migrate(MIGRATIONS_ROOT + "/valid")
|
||||
assert_equal([1,2,3], ActiveRecord::Migrator.get_all_versions)
|
||||
|
||||
ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
|
||||
assert_equal([1,2], ActiveRecord::Migrator.get_all_versions)
|
||||
|
||||
ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
|
||||
assert_equal([1], ActiveRecord::Migrator.get_all_versions)
|
||||
|
||||
ActiveRecord::Migrator.rollback(MIGRATIONS_ROOT + "/valid")
|
||||
assert_equal([], ActiveRecord::Migrator.get_all_versions)
|
||||
end
|
||||
|
||||
def test_schema_migrations_table_name
|
||||
ActiveRecord::Base.table_name_prefix = "prefix_"
|
||||
ActiveRecord::Base.table_name_suffix = "_suffix"
|
||||
|
|
|
@ -328,6 +328,22 @@ module ActiveRecord
|
|||
assert_equal [[:up, 2], [:up, 3]], calls
|
||||
end
|
||||
|
||||
def test_get_all_versions
|
||||
_, migrator = migrator_class(3)
|
||||
|
||||
migrator.migrate("valid")
|
||||
assert_equal([1,2,3], ActiveRecord::Migrator.get_all_versions)
|
||||
|
||||
migrator.rollback("valid")
|
||||
assert_equal([1,2], ActiveRecord::Migrator.get_all_versions)
|
||||
|
||||
migrator.rollback("valid")
|
||||
assert_equal([1], ActiveRecord::Migrator.get_all_versions)
|
||||
|
||||
migrator.rollback("valid")
|
||||
assert_equal([], ActiveRecord::Migrator.get_all_versions)
|
||||
end
|
||||
|
||||
private
|
||||
def m(name, version, &block)
|
||||
x = Sensor.new name, version
|
||||
|
|
Loading…
Reference in New Issue