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...