Merge #​2659 "Use Rails transactional tests"

This commit is contained in:
Andrew Kvalheim 2020-06-26 20:19:36 -07:00
commit 943f0afaaf
8 changed files with 4 additions and 39 deletions

View file

@ -2,16 +2,7 @@
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:transaction)
DatabaseCleaner.clean_with(:truncation)
Rails.application.load_seed
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do |example|
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page) if example.metadata[:js]
DatabaseCleaner.clean
end
end

View file

@ -1,14 +0,0 @@
# frozen_string_literal: true
module ActiveRecord
class Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection