remove more code for supporting older gems

This commit is contained in:
Thomas Walpole 2016-08-17 20:16:32 -07:00
parent 8826156be9
commit 9d90d6c625
3 changed files with 5 additions and 15 deletions

View File

@ -152,12 +152,7 @@ module Capybara
#
# @return [String] The title of the document
def title
if native.respond_to? :title
native.title
else
#old versions of nokogiri don't have #title - remove in 3.0
native.xpath('/html/head/title | /html/title').first.text
end
native.title
end
def inspect

View File

@ -105,12 +105,7 @@ class Capybara::RackTest::Browser
end
def title
if dom.respond_to? :title
dom.title
else
#old versions of nokogiri don't have #title - remove in 3.0
dom.xpath('/html/head/title | /html/title').first.text
end
dom.title
end
protected

View File

@ -14,11 +14,11 @@ Capybara::SpecHelper.spec '#current_url, #current_path, #current_host' do
end
def should_be_on server_index, path="/host", scheme="http"
#This delay is to give fully async drivers (selenium w/chromedriver) time for the browser
#to get to its destination - should be removed when we have a waiting current_url matcher
sleep 0.1 # remove and adjust tests when a waiting current_url/path matcher is implemented
# Check that we are on /host on the given server
s = @servers[server_index]
expect(@session).to have_current_path("#{scheme}://#{s.host}:#{s.port}#{path}", url: true)
expect(@session.current_url.chomp('?')).to eq("#{scheme}://#{s.host}:#{s.port}#{path}")
expect(@session.current_host).to eq("#{scheme}://#{s.host}") # no port
expect(@session.current_path).to eq(path)