Ensure that .up and .down work as well.
This commit is contained in:
parent
74d7bfb200
commit
43fc814074
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user