
Nested have_xpath (or have_selector) doesn't search the whole subtree
Reported by Luismi Cavallé | April 16th, 2009 @ 05:16 AM
If you have the following HTML:
<div>
<ul>
<li>wadus</li>
</ul>
</div>
The following code to test it:
response.should have_selector("div") do |node|
node.should have_selector("li")
end
The test fails because the li element isn't a direct child of the div element.
I don't know if this is a bug or a feature, but I think is pretty much useful that nested selectors search the whole subtree, not only the root.
This patch make have_xpath (therefore have_selector) work this
way:
http://github.com/cavalle/webrat/commit/7810fd27de2b30b2462aa5657cd...
Comments and changes to this ticket
-
gaffo May 7th, 2009 @ 06:59 PM
- Tag changed from patch to patch, verify
- State changed from new to awaiting-patch
Patch looks good. Just need to verify it.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Ruby Acceptance Testing for Web applications.
People watching this ticket
Referenced by
-
234 have_selector and have_xpath don't match descendants in blocks just realized this is a duplicate of https://webrat.ligh...
-
234 have_selector and have_xpath don't match descendants in blocks tomo, Thanks for the patch and the report. I'm a bit conf...
-
234 have_selector and have_xpath don't match descendants in blocks So to clarify, please put in the patch that works. I'm ta...
-
234 have_selector and have_xpath don't match descendants in blocks It's pretty related to #220... same fix except for an ext...