Capybara page.has_content? does not work in Cucumber tests


You are trying to use page.has_content? inside a cucumber step definition, but it doesn’t work as it matches all text, and returns always true.


Change the page.has_content? to page.should have_content instead and the tests should be failing when the text doesn’t match.