# Perform a Capybara.visit to the given hostname. | |
def visit_path(path, at_host:) | |
MyRailsHelper.set_capybara_host(to_domain: at_host) | |
Capybara.visit path | |
end | |
module MyRailsHelper | |
def self.set_capybara_host(to_domain:) | |
Capybara.current_session.driver.reset! | |
Capybara.app_host = "http://#{to_domain}" | |
Capybara.always_include_port = true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment