mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Include port in URLs generated by system specs
This means that we can follow generated links, for example in emails and reach the test app server.
This commit is contained in:
@@ -34,7 +34,8 @@ RSpec.configure do |config|
|
||||
# Make sure url helpers in mailers use the Capybara server host.
|
||||
config.around(:each, type: :system) do |example|
|
||||
original_host = Rails.application.default_url_options[:host]
|
||||
Rails.application.default_url_options[:host] = Capybara.server_host
|
||||
Rails.application.default_url_options[:host] =
|
||||
"#{Capybara.current_session.server.host}:#{Capybara.current_session.server.port}"
|
||||
example.run
|
||||
Rails.application.default_url_options[:host] = original_host
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user