Skip to content

Commit

Permalink
Merge pull request rails#52130 from rails/fxn/trx-transaction-guide
Browse files Browse the repository at this point in the history
Document test transactions w/ multiple databases
  • Loading branch information
fxn committed Jun 15, 2024
2 parents 3342f13 + ec056dd commit 23729ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions guides/source/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,12 @@ class MyTest < ActiveSupport::TestCase
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:

```ruby
Expand Down

0 comments on commit 23729ce

Please sign in to comment.