Skip to content
Browse files

Ensure that .up and .down work as well.

  • Loading branch information...
1 parent 74d7bfb commit 43fc81407495a31465bc3559bc0703fd328f2308 @cmeiklejohn cmeiklejohn committed with tenderlove Jul 29, 2011
Showing with 13 additions and 2 deletions.
  1. +13 −2 activerecord/test/cases/invertible_migration_test.rb
View
15 activerecord/test/cases/invertible_migration_test.rb
@@ -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

0 comments on commit 43fc814

Please sign in to comment.
Something went wrong with that request. Please try again.