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

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

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

but cucumber tells me:

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


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

Patrick J. Collins
http://collinatorstudios.com
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:

https://github.com/jnicklas/capybara/blob/master/l...

HTH,
David
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
no.

https://github.com/jnicklas/capybara/blob/master/l...
This topic is locked and can not be replied to.