diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-01-19 11:51:07 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-01-19 11:51:07 +0900 |
commit | f5c4b7cf13b6e0703971968a44d3b1a9df9744fd (patch) | |
tree | 4ba41a01f59e469a1cdbb069e6a6f301f64c89f6 | |
parent | 6d1dd1643dc8a2dece837af331a4c5d26ac04f30 (diff) | |
download | rails-f5c4b7cf13b6e0703971968a44d3b1a9df9744fd.tar.gz rails-f5c4b7cf13b6e0703971968a44d3b1a9df9744fd.tar.bz2 rails-f5c4b7cf13b6e0703971968a44d3b1a9df9744fd.zip |
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.
-rw-r--r-- | activerecord/test/cases/migrator_test.rb | 18 |
1 files changed, 11 insertions, 7 deletions
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 |