I am writing an app where it is desirable to check if a view does not have some functionality - in particular because that functionality must be presented only to users
I had this problem to ensure there WASN'T a 'Delete' button, out of many buttons. The accepted answer would not work in this situation because there are already several buttons.
assert_select '.button' do |btn|
btn.each do |b|
assert_no_match 'Delete', b.to_s
end
end
However, I really like GantMan's answer better!