From d9bb8cee0a6d242510e804f1808b3d30926054a3 Mon Sep 17 00:00:00 2001 From: Phill Baker Date: Sun, 5 Oct 2014 18:16:11 -0400 Subject: [PATCH] Replace hardcoded `localhost` in spec helper. This test had a hardcoded values for the URI to visit which varies for different test cases. When these specs are integrated in custom driver's test suite like capybara-mechanize, it leads to failures. This replaces #1227, which was rejected for changing the original purpose of the test. However, this patch only changes the hardcoding. It will allow https://github.com/jeroenvandijk/capybara-mechanize/issues/55 to proceed and bump it's compatibility to beyond capybara 2.1. --- lib/capybara/spec/session/visit_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/spec/session/visit_spec.rb b/lib/capybara/spec/session/visit_spec.rb index b6531d84b..dac6740ed 100644 --- a/lib/capybara/spec/session/visit_spec.rb +++ b/lib/capybara/spec/session/visit_spec.rb @@ -22,7 +22,7 @@ @session.visit('/foo/bar') root_uri = URI.parse(@session.current_url) - @session.visit("http://localhost:#{root_uri.port}") + @session.visit("http://#{root_uri.host}:#{root_uri.port}") expect(@session).to have_content('Hello world!') end