fix for issue #1524

This commit is contained in:
Thomas Walpole 2015-05-28 10:51:23 -07:00
parent 3ae284460b
commit ae2becd025
5 changed files with 9 additions and 5 deletions

View File

@ -146,7 +146,7 @@ module Capybara
end
def title
native.xpath("//title").first.text
native.title
end
def inspect

View File

@ -96,7 +96,7 @@ class Capybara::RackTest::Browser
end
def title
dom.xpath("//title").text
dom.title
end
protected

View File

@ -1,13 +1,13 @@
Capybara::SpecHelper.spec '#title' do
it "should print the title of the page" do
it "should get the title of the page" do
@session.visit('/with_title')
expect(@session.title).to eq('Test Title')
end
context "with css as default selector" do
before { Capybara.default_selector = :css }
it "should print the title of the page" do
it "should get the title of the page" do
@session.visit('/with_title')
expect(@session.title).to eq('Test Title')
end

View File

@ -1 +1,4 @@
<title>Test Title</title>
<title>Test Title</title>
<body>
<svg><title>abcdefg</title></svg>
</body>

View File

@ -9,6 +9,7 @@ RSpec.describe Capybara do
<title>simple_node</title>
</head>
<body>
<svg><title>not document title</title></svg>
<div id="page">
<div id="content">
<h1 data="fantastic">Totally awesome</h1>