Commit graph

15 commits

Author SHA1 Message Date
Andrew Kvalheim
c3e02c20b9
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.
2021-03-06 19:41:06 +01:00
Andrew Kvalheim
310fc8dc68
Fix bug in test database preparation
Presumably the intent of this was to clear the database and repopulate
it with seed data. `transaction` isn't the right strategy for this; it
just rolls back any existing transactions.
2021-03-06 19:41:06 +01:00
James Mason
a9e8498abe transactional db support for capybara tests! 2018-11-19 08:40:55 -08:00
James Mason
6d31dfeef4 Add frozen_string_literal magic comment
re: https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FrozenStringLiteralComment
2018-05-09 06:54:26 -07:00
siddhantbajaj
0496ed23e5 Improves test speed 2017-06-15 04:26:15 +05:30
Christian Bruckmayer
322d58c61c
Revert "fixed travis issues"
This reverts commit 1255088ff0.

Because it broke our heroku deployment
2017-03-03 15:07:54 +01:00
Siddhant Bajaj
1255088ff0 fixed travis issues 2017-02-20 23:43:02 +05:30
Ana María Martínez Gómez
e4104ba2cd Fix the Travis failures in rspec 2017-01-11 10:07:25 +01:00
Ana María Martínez Gómez
7ebf44d1e4 Improvements in the DatabaseCleaner
Move all what is related to the DatabaseCleaner to the
database_cleaner.rb file. Load the seeds only when they have been
deleted and not before every test.
2017-01-11 10:03:27 +01:00
Hernan Schmidt
244172a9bc Clean up DatabaseCleaner usage 2016-08-18 18:32:06 +02:00
Stella Rouzi
f91467a00a remove trailing spaces and blank lines 2014-09-02 21:41:25 +03:00
Artem Chernikov
5289f41eb5 Use only new hash syntax 2014-07-21 15:05:58 +02:00
Gopesh Tulsyan
f84f3b97a7 some basic tests for admin/users controller, fixed bug in admin/users controller for displaying users
Fixes by hounci violations
2014-06-02 18:22:55 +05:30
Chrisbr
f96ff6ed17 Fix Hound CI violations 2014-05-10 16:02:44 +02:00
Chrisbr
8aa68fb84a Installs database cleaner
- preparation for feature tests with capybara
see:
http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/
2014-05-10 15:55:17 +02:00