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
module ActionDispatch::Assertions::SelectorAssertions
def refute_select(*a,&b)
begin
assert_select(*a,&b)
rescue AssertionFailedError
return
end
raise "fail" # there should be a better built-in alternative
end
end