diff options
author | Christopher Meiklejohn <christopher.meiklejohn@gmail.com> | 2011-07-29 23:17:12 -0400 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:27 -0700 |
commit | 9d31acf8b9e8c106f5cac2348a55de0f553458c1 (patch) | |
tree | 747ccfba20ae292c1bae163ad3475730c5d4ab0a /activerecord/test | |
parent | 9d19bae233d7a2ce9adac39b6b6e91de85729def (diff) | |
download | rails-9d31acf8b9e8c106f5cac2348a55de0f553458c1.tar.gz rails-9d31acf8b9e8c106f5cac2348a55de0f553458c1.tar.bz2 rails-9d31acf8b9e8c106f5cac2348a55de0f553458c1.zip |
Ensure that .up and .down work as well.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/invertible_migration_test.rb | 15 |
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 |