Merge some contributor fixes

This commit is contained in:
Michael Ball 2020-06-30 00:48:47 -07:00
commit 0877aadb2e
72 changed files with 225 additions and 206 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

@ -2,7 +2,10 @@
# Mock external requests to youtube
require 'webmock/rspec'
WebMock.disable_net_connect!(allow_localhost: true, allow: /stripe.com/)
driver_urls = Webdrivers::Common.subclasses.map do |driver|
Addressable::URI.parse(driver.base_url).host
end
WebMock.disable_net_connect!(allow_localhost: true, allow: [*driver_urls, /stripe.com/])
RSpec.configure do |config|
config.before(:each) do

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

View file

@ -9,7 +9,7 @@ RSpec.configure do |config|
example_filename += '.html'
if RSpec.current_example.exception.present?
save_page(example_filename)
save_page(example_screenshotname)
save_screenshot(example_screenshotname) # rubocop:disable Lint/Debugger
# remove the file if the test starts working again
else
File.unlink(example_filename) if File.exist?(example_filename)