stop more ddl changes

This commit is contained in:
Aaron Patterson 2012-01-16 15:24:27 -08:00
parent 86a73cd849
commit 21afd9b96d
2 changed files with 16 additions and 14 deletions

View File

@ -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"

View File

@ -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