Forum: RSpec using rspec to verify an xpath (via capybara/cucumber)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
648553f5c693d93c9ea2e042857ad22c?d=identicon&s=25 Patrick Collins (patrick99e99)
on 2011-09-20 23:51
(Received via mailing list)
I am doing:

  page.should have_xpath("//img[contains(@class, 'foobar')]", :count =>

but cucumber tells me:

expected xpath "//img[contains(@class, 'foobar')]" to return something

...  Shouldn't this be returning true/false ?

Patrick J. Collins
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2011-09-21 00:06
(Received via mailing list)
On Sep 20, 2011, at 11:45 PM, Patrick J. Collins wrote:

> ...  Shouldn't this be returning true/false ?
have_xpath is a Capybara matcher that defines its own failure message:

1df9fc8ddf084661265bbae74a8d0b43?d=identicon&s=25 Justin Ko (Guest)
on 2011-09-21 00:26
(Received via mailing list)
"have_[xpath]" is a custom matcher in Capybara. So, the answer would be
This topic is locked and can not be replied to.