Can anybody explain me the difference between "page.should_not have_content" and "page.should have_no_content" in capybara and which one is the better option to ensure page does not have a specific content?
Asked
Active
Viewed 269 times
1 Answers
4
Assuming Capybara::RSpecMatchers has been included correctly there is no real difference in the two methods you're asking about, they both boil down to running current_scope_element.assert_no_text(...)

Thomas Walpole
- 48,548
- 5
- 64
- 78
-
So, one is not better over another? – A J Feb 28 '18 at 03:22
-
1@AJ nope - they both do the same thing, pick the one you prefer. The only technical difference would be the error messages produced in case of failure. – Thomas Walpole Feb 28 '18 at 18:28