fix for issue #1524
This commit is contained in:
parent
3ae284460b
commit
ae2becd025
|
@ -146,7 +146,7 @@ module Capybara
|
|||
end
|
||||
|
||||
def title
|
||||
native.xpath("//title").first.text
|
||||
native.title
|
||||
end
|
||||
|
||||
def inspect
|
||||
|
|
|
@ -96,7 +96,7 @@ class Capybara::RackTest::Browser
|
|||
end
|
||||
|
||||
def title
|
||||
dom.xpath("//title").text
|
||||
dom.title
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
<title>Test Title</title>
|
||||
<body>
|
||||
<svg><title>abcdefg</title></svg>
|
||||
</body>
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue