Skip to content

Commit f3b81e2

Browse files
authored
Update comment about ActiveRecord::Migration.maintain_test_schema! (#2832)
The original comment implies that `maintain_test_schema!` applies pending migrations, but in reality, it purges and recreates the database, then loads the schema.
1 parent 5fead52 commit f3b81e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/generators/rspec/install/templates/spec/rails_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
# Rails.root.glob('spec/support/**/*.rb').sort_by(&:to_s).each { |f| require f }
2929
3030
<% if RSpec::Rails::FeatureCheck.has_active_record_migration? -%>
31-
# Checks for pending migrations and applies them before tests are run.
31+
# Ensures that the test database schema matches the current schema file.
32+
# If there are pending migrations it will invoke `db:test:prepare` to
33+
# recreate the test database by loading the schema.
3234
# If you are not using ActiveRecord, you can remove these lines.
3335
begin
3436
ActiveRecord::Migration.maintain_test_schema!

0 commit comments

Comments
 (0)