Why does the following step pass:
page.has_css?("doesnt exist")
when this correctly fails:
page.should have_css("doesnt exist")
If I run:
puts page.has_css?("doesnt exist")
it prints “false”, but the step still passes.
Any idea why?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should probably have:
If you write “2 == 3” in a test, it will evaluate to false, but the test method will not necessarily fail. You need an assert. I think the “should” style syntax are doing some kind of assert under the hood as well.