1
0
Fork 0
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:
Ryuta Kamizono 2019-03-05 21:05:50 +09:00
parent 5083f3fd60
commit db94f492c0

View file

@ -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