“page.should_not have_content”和“page.should have_no_content”之间的区别

时间:2021-11-09 19:43:43

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?

任何人都能解释一下capybara中“page.should_not have_content”和“page.should have_no_content”之间的区别,哪一个更好的选择是确保页面没有特定的内容?

1 个解决方案

#1


2  

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(...)

假设正确包含了Capybara :: RSpecMatchers,那么你要问的两种方法没有什么区别,它们都归结为运行current_scope_element.assert_no_text(...)

#1


2  

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(...)

假设正确包含了Capybara :: RSpecMatchers,那么你要问的两种方法没有什么区别,它们都归结为运行current_scope_element.assert_no_text(...)