如何使用assert_select测试内容

时间:2015-06-04 09:17:52

标签: ruby-on-rails

' assert_tag'方法已弃用。 如何仅使用assert_select重构此规范?

assert_no_tag :tag => 'p', :content => /Are you sure you want to delete this user/

1 个答案:

答案 0 :(得分:2)

您希望断言与文本匹配的选择器将返回一个空数组:

assert_select "p", text: /Are you sure/, count: 0