I am trying to test a link, I hope I can solve this issue:
I tried to test the link like this:
nested_element= "div.page_margins div.page iv#nav div.hlist ul li#2"
within(nested_element) do
response.body.should have_link("Next", :href=>"javascript: void(0)")
end
But I get this error:
Capybara::ElementNotFound: Unable to find css "div.page_margins div.page div#nav div.hlist ul li#2"
Although the same selector is working fine using have_selector:
response.body.should have_selector(nested_element)
Any idea please ?