0
我需要一种方法来检查一个元素是否有孩子。水豚/ Poltergeist:检查div有小孩
<div class="purchaseRoMPixels">
<img style="display:none" src="//api.com;value=20">
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com" /></noscript>
</div>
我尝试以下,但他们不工作
find(".purchaseRomPixels").children.length.should > 0
这也并不正确测试什么,我想测试
find(".purchaseRoMPixels").text.should == ""
这将始终返回true,因为有该div中没有文字。但我希望它只有在div中存在这些元素时才会返回true。