mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Reset connection_handlers
to default when any test dirties that
Most existing tests expects `connection_handlers` has only one default handler, but the test added at #34779 dirties that. We need to reset `connection_handlers` to default in that case. Closes #35471.
This commit is contained in:
parent
5083f3fd60
commit
db94f492c0
1 changed files with 4 additions and 0 deletions
|
@ -951,6 +951,10 @@ module ActiveRecord
|
|||
|
||||
fixtures :authors, :author_addresses
|
||||
|
||||
def teardown
|
||||
ActiveRecord::Base.connection_handlers = { writing: ActiveRecord::Base.default_connection_handler }
|
||||
end
|
||||
|
||||
def test_truncate_tables
|
||||
assert_operator Author.count, :>, 0
|
||||
assert_operator AuthorAddress.count, :>, 0
|
||||
|
|
Loading…
Reference in a new issue