forked from fixin.me/fixin.me
Discontinue MySQL support
This is intended to reduce development effort. Support may be reintroduced later, if justified.
This commit is contained in:
@@ -4,7 +4,7 @@ require "test_helper"
|
||||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||
include ActionView::Helpers::UrlHelper
|
||||
|
||||
# NOTE: geckodriver installed with Firefox, ignore incompatibility warning
|
||||
# `geckodriver` installed with Firefox, ignore incompatibility warning.
|
||||
Selenium::WebDriver.logger
|
||||
.ignore(:selenium_manager, :clear_session_storage, :clear_local_storage)
|
||||
|
||||
@@ -33,33 +33,24 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||
button.html_safe)
|
||||
end
|
||||
|
||||
DB_CONFIGS = ActiveRecord::Base.configurations.configs_for(env_name: "test")
|
||||
TEST_CONFIGS = Hash.new(DB_CONFIGS.first.name.to_sym)
|
||||
class << self
|
||||
# NOTE: alternative to current solution is to create shards:
|
||||
# ActiveRecord::Base.connects_to(
|
||||
# shards: {mysql2: {writing: :mysql2}, sqlite3: {writing: :sqlite3}}
|
||||
# )
|
||||
# and use them in one of the following ways:
|
||||
# * set config.active_record.shard_selector/shard_resolver
|
||||
# * run tests within: ActiveRecord::Base.connected_to(shard: :sqlite3) { test_ }
|
||||
# Remove this note once current solution is confirmed to work.
|
||||
#
|
||||
# Test block should not be modified here, as it would change its binding from
|
||||
# instance level to class level.
|
||||
# TODO: allow multiple iterations of tests? would require saving seed in
|
||||
# #setup to make reproducing easier
|
||||
if DB_CONFIGS.many?
|
||||
def test(name, ...)
|
||||
DB_CONFIGS.each do |config|
|
||||
TEST_CONFIGS[super("#{config.name} #{name}", ...)] = config.name.to_sym
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
setup do
|
||||
ActiveRecord::Base.establish_connection(TEST_CONFIGS[name.to_sym])
|
||||
end
|
||||
#DB_CONFIGS = ActiveRecord::Base.configurations.configs_for(env_name: "test")
|
||||
#TEST_CONFIGS = Hash.new(DB_CONFIGS.first.name.to_sym)
|
||||
#class << self
|
||||
# # Test block should not be modified here, as it would change its binding from
|
||||
# # instance level to class level.
|
||||
# # TODO: allow multiple iterations of tests? would require saving seed in
|
||||
# # #setup to make reproducing easier
|
||||
# if DB_CONFIGS.many?
|
||||
# def test(name, ...)
|
||||
# DB_CONFIGS.each do |config|
|
||||
# TEST_CONFIGS[super("#{config.name} #{name}", ...)] = config.name.to_sym
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
#end
|
||||
#setup do
|
||||
# ActiveRecord::Base.establish_connection(TEST_CONFIGS[name.to_sym])
|
||||
#end
|
||||
|
||||
Capybara.modify_selector(:link) do
|
||||
expression_filter(:disabled) do |xpath, value|
|
||||
|
||||
Reference in New Issue
Block a user