From f5c4b7cf13b6e0703971968a44d3b1a9df9744fd Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Fri, 19 Jan 2018 11:51:07 +0900 Subject: Restore `test_migrations_status_with_schema_define_in_subdirectories` This test case which was added in #28287 checks that `ActiveRecord::Schema.define` loads migration versions in subdirectories. It should be kept it as it was. --- activerecord/test/cases/migrator_test.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/migrator_test.rb b/activerecord/test/cases/migrator_test.rb index d674e4506e..873455cf67 100644 --- a/activerecord/test/cases/migrator_test.rb +++ b/activerecord/test/cases/migrator_test.rb @@ -176,16 +176,20 @@ class MigratorTest < ActiveRecord::TestCase end def test_migrations_status_with_schema_define_in_subdirectories - _, migrator = migrator_class(3) - migrator = migrator.new("valid_with_subdirectories") + path = MIGRATIONS_ROOT + "/valid_with_subdirectories" + prev_paths = ActiveRecord::Migrator.migrations_paths + ActiveRecord::Migrator.migrations_paths = path - migrator.migrate + ActiveRecord::Schema.define(version: 3) do + end assert_equal [ - ["up", "001", "********** NO FILE **********"], - ["up", "002", "********** NO FILE **********"], - ["up", "003", "********** NO FILE **********"], - ], migrator.migrations_status + ["up", "001", "Valid people have last names"], + ["up", "002", "We need reminders"], + ["up", "003", "Innocent jointable"], + ], ActiveRecord::MigrationContext.new(path).migrations_status + ensure + ActiveRecord::Migrator.migrations_paths = prev_paths end def test_migrations_status_from_two_directories -- cgit v1.2.3