2012-08-16 22 views
0
<div id="look_here"> 
    <a href="stackoverflow.com"><img src="xxxxxxxxxx.xxx"></a> 
</div> 

如何測試水豚(和RSpec)中的此鏈接?如何測試與水豚鏈接的http ref

該圖像是動態生成的,所以我只想測試href

回答

1

這應該工作:

page.should have_xpath("//a[@href='stackoverflow.com']")