Maintenance: Ensure that FQDN Setting has correct host and port value in Capybara system test context.

This commit is contained in:
Thorsten Eckel 2020-12-10 10:17:26 +01:00
parent c35c00fa57
commit e6379bc2ab

View file

@ -3,8 +3,15 @@ require_relative './set_up'
RSpec.configure do |config|
config.before(:each, type: :system) do
# start a silenced Puma as application server
Capybara.server = :puma, { Silent: true, Host: '0.0.0.0', Threads: '0:16' }
Capybara.register_server :puma_wrapper do |app, port, host, **_options|
# update fqdn Setting according to random assigned Rack server port
Setting.set('fqdn', "#{host}:#{port}")
# start a silenced Puma as application server
Capybara.servers[:puma].call(app, port, host, { Silent: true, Host: '0.0.0.0', Threads: '0:16' })
end
Capybara.server = :puma_wrapper
# set the Host from gather container IP for CI runs
if ENV['CI'].present?