提交 43fc8140 编写于 作者: C Christopher Meiklejohn 提交者: Aaron Patterson

Ensure that .up and .down work as well.

上级 74d7bfb2
......@@ -54,13 +54,13 @@ def test_no_reverse
end
end
def test_up
def test_migrate_up
migration = InvertibleMigration.new
migration.migrate(:up)
assert migration.connection.table_exists?("horses"), "horses should exist"
end
def test_down
def test_migrate_down
migration = InvertibleMigration.new
migration.migrate :up
migration.migrate :down
......@@ -77,5 +77,16 @@ def test_legacy_down
LegacyMigration.migrate :down
assert !ActiveRecord::Base.connection.table_exists?("horses"), "horses should not exist"
end
def test_up
LegacyMigration.up
assert ActiveRecord::Base.connection.table_exists?("horses"), "horses should exist"
end
def test_down
LegacyMigration.up
LegacyMigration.down
assert !ActiveRecord::Base.connection.table_exists?("horses"), "horses should not exist"
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册