2

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?

A J
  • 1,439
  • 4
  • 25
  • 42

1 Answers1

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