0
這是在我的測試代碼:assert_select預期自相矛盾(紅寶石)
assert_select "a[href=?]", "/path/with?params", { :count => 1, :text => "" }
這是失敗的消息,我得到:
Expected exactly 1 element matching "a[href='/path/with?params']", found 0..
Expected: 0
Actual: 1
任何線索這裏發生了什麼?它是否期待0或1,並找到1或0?
UPDATE:給大家來這裏尋找如何做什麼,我要怎樣做,我最後做的:
assert_match(/<a href="/path/with?params">/, response.body)