DEV: Allow Capybara's server port to be configurable (#23606)

Why this change?

This allows scripts to configure the server port and avoid hardcoding
the default port that is used in Discourse core.
This commit is contained in:
Alan Guo Xiang Tan 2023-09-15 11:46:03 +08:00 committed by GitHub
parent bbad09df0e
commit 9b5ab7a764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -310,7 +310,9 @@ RSpec.configure do |config|
Capybara.configure do |capybara_config|
capybara_config.server_host = ENV["CAPYBARA_SERVER_HOST"].presence || "localhost"
capybara_config.server_port = 31_337 + ENV["TEST_ENV_NUMBER"].to_i
capybara_config.server_port =
(ENV["CAPYBARA_SERVER_PORT"].presence || "31_337").to_i + ENV["TEST_ENV_NUMBER"].to_i
end
module IgnoreUnicornCapturedErrors