aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/migration_generator_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators/migration_generator_test.rb')
-rw-r--r--railties/test/generators/migration_generator_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb
index 6e1d1b70a9..5ad4372833 100644
--- a/railties/test/generators/migration_generator_test.rb
+++ b/railties/test/generators/migration_generator_test.rb
@@ -309,6 +309,16 @@ class MigrationGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_add_migration_to_configured_path
+ old_paths = Rails.application.config.paths["db/migrate"]
+ Rails.application.config.paths.add "db/migrate", with: "db2/migrate"
+
+ migration = "migration_in_custom_path"
+ run_generator [migration]
+ Rails.application.config.paths["db/migrate"] = old_paths
+ assert_migration "db2/migrate/#{migration}.rb", /.*/
+ end
+
private
def with_singular_table_name