Use Rails transactional tests

As of Rails 5.1:

  - Rails has built-in support for running tests within database
    transactions, so Database Cleaner is no longer needed for this.
  - Rails automatically shares the database connection across threads,
    so transactional_capybara is no longer needed.

Changes:

  - Enable `use_transactional_tests`.
  - Remove transactional_capybara.
  - Remove the Database Cleaner test wrapper.

This resolves:

  - transactional_capybara mismanages the shared database connection,
    causing the connection to falsely report as idle after the first
    test. At 6 minutes (idle_timeout + reaping_frequency) into testing,
    the connection is closed, causing e.g. `PG::ConnectionBad` errors.
This commit is contained in:
Andrew Kvalheim 2020-04-05 12:51:30 -07:00
parent 11a7e056bf
commit ae00a7f055
7 changed files with 3 additions and 24 deletions

View file

@ -566,8 +566,6 @@ GEM
thread_safe (0.3.6)
tilt (2.0.9)
timecop (0.9.1)
transactional_capybara (0.2.0)
capybara
transitions (1.2.1)
ttfunk (1.5.1)
turbolinks (5.2.1)
@ -715,7 +713,6 @@ DEPENDENCIES
stripe
stripe-ruby-mock
timecop
transactional_capybara
transitions
turbolinks
uglifier (>= 1.3.0)