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

问题描述 投票:1回答:1

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

ruby rspec capybara
1个回答
3
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.