aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration_test.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-10-31 15:20:44 -0600
committerSean Griffin <sean@thoughtbot.com>2014-10-31 15:21:17 -0600
commit61bacd6ef9c302238f3b8d9e6b432ee2090f6b78 (patch)
tree77338d330b4cf6e7755040bb3099530f4eb83ccb /activerecord/test/cases/migration_test.rb
parent487145f871d93a56d128b135720d8059e831985d (diff)
downloadrails-61bacd6ef9c302238f3b8d9e6b432ee2090f6b78.tar.gz
rails-61bacd6ef9c302238f3b8d9e6b432ee2090f6b78.tar.bz2
rails-61bacd6ef9c302238f3b8d9e6b432ee2090f6b78.zip
Load test schema even if there are no migrations
Fixes #17170
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r--activerecord/test/cases/migration_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 8db01fc847..6b7a0a9000 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -100,6 +100,19 @@ class MigrationTest < ActiveRecord::TestCase
ActiveRecord::Migrator.migrations_paths = old_path
end
+ def test_any_migrations
+ old_path = ActiveRecord::Migrator.migrations_paths
+ ActiveRecord::Migrator.migrations_paths = MIGRATIONS_ROOT + "/valid"
+
+ assert ActiveRecord::Migrator.any_migrations?
+
+ ActiveRecord::Migrator.migrations_paths = MIGRATIONS_ROOT + "/empty"
+
+ assert_not ActiveRecord::Migrator.any_migrations?
+ ensure
+ ActiveRecord::Migrator.migrations_paths = old_path
+ end
+
def test_migration_version
ActiveRecord::Migrator.run(:up, MIGRATIONS_ROOT + "/version_check", 20131219224947)
end