Merge pull request #52130 from rails/fxn/trx-transaction-guide

Document test transactions w/ multiple databases
This commit is contained in:
Xavier Noria 2024-06-15 13:55:36 +02:00 committed by GitHub
commit 23729cec4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -429,6 +429,12 @@ class MyTest < ActiveSupport::TestCase
end end
``` ```
If there are [multiple writing databases](active_record_multiple_databases.html)
in place, tests are wrapped in as many respective transactions, and all of them
are rolled back.
#### Opting-out of Test Transactions
Individual test cases can opt-out: Individual test cases can opt-out:
```ruby ```ruby