aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration_test.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2010-12-03 13:12:59 +0100
committerPiotr Sarnacki <drogus@gmail.com>2010-12-09 00:04:36 +0100
commitd0467e08e54a84fc4672c508716615aa0177994a (patch)
tree2c5600d38641129ebe14da2c8fe5da26736cbb70 /activerecord/test/cases/migration_test.rb
parente924814b28d655242a49f543cf453d55712071b1 (diff)
downloadrails-d0467e08e54a84fc4672c508716615aa0177994a.tar.gz
rails-d0467e08e54a84fc4672c508716615aa0177994a.tar.bz2
rails-d0467e08e54a84fc4672c508716615aa0177994a.zip
Allow to run migrations from more than one directory
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r--activerecord/test/cases/migration_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 96da3be655..95b7ce9f34 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -1275,6 +1275,18 @@ if ActiveRecord::Base.connection.supports_migrations?
end
end
+ def test_finds_migrations_from_two_directories
+ directories = [MIGRATIONS_ROOT + '/valid_with_timestamps', MIGRATIONS_ROOT + '/to_copy_with_timestamps']
+ migrations = ActiveRecord::Migrator.new(:up, directories).migrations
+
+ [[20090101010101, "PeopleHaveHobbies"], [20090101010202, "PeopleHaveDescriptions"],
+ [20100101010101, "PeopleHaveLastNames"], [20100201010101, "WeNeedReminders"],
+ [20100301010101, "InnocentJointable"]].each_with_index do |pair, i|
+ assert_equal migrations[i].version, pair.first
+ assert_equal migrations[i].name, pair.last
+ end
+ end
+
def test_finds_pending_migrations
ActiveRecord::Migrator.up(MIGRATIONS_ROOT + "/interleaved/pass_2", 1)
migrations = ActiveRecord::Migrator.new(:up, MIGRATIONS_ROOT + "/interleaved/pass_2").pending_migrations