aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/invertible_migration_test.rb
diff options
context:
space:
mode:
authorChristopher Meiklejohn <christopher.meiklejohn@gmail.com>2011-07-29 23:17:12 -0400
committerAaron Patterson <aaron.patterson@gmail.com>2011-08-02 18:57:34 -0700
commit43fc81407495a31465bc3559bc0703fd328f2308 (patch)
tree7d3cb218897fa026f9405839348cf164a9883ffd /activerecord/test/cases/invertible_migration_test.rb
parent74d7bfb200e4590e244558554e147a31d30990df (diff)
downloadrails-43fc81407495a31465bc3559bc0703fd328f2308.tar.gz
rails-43fc81407495a31465bc3559bc0703fd328f2308.tar.bz2
rails-43fc81407495a31465bc3559bc0703fd328f2308.zip
Ensure that .up and .down work as well.
Diffstat (limited to 'activerecord/test/cases/invertible_migration_test.rb')
-rw-r--r--activerecord/test/cases/invertible_migration_test.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/activerecord/test/cases/invertible_migration_test.rb b/activerecord/test/cases/invertible_migration_test.rb
index acba4a134e..3ae7b63dff 100644
--- a/activerecord/test/cases/invertible_migration_test.rb
+++ b/activerecord/test/cases/invertible_migration_test.rb
@@ -54,13 +54,13 @@ module ActiveRecord
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 @@ module ActiveRecord
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