Add assert_in_body helper

Coming upstream
This commit is contained in:
David Heinemeier Hansson
2025-04-18 16:06:30 +02:00
parent 1026408736
commit fd21838f88
2 changed files with 13 additions and 3 deletions
+10
View File
@@ -11,5 +11,15 @@ module ActiveSupport
fixtures :all
include CardTestHelper, ChangeTestHelper, SessionTestHelper
# FIXME: Remove when upstream in Rails has landed (https://github.com/rails/rails/pull/54938)
def assert_in_body(text)
assert_match /#{text}/, @response.body
end
# FIXME: Remove when upstream in Rails has landed (https://github.com/rails/rails/pull/54938)
def assert_not_in_body(text)
assert_no_match /#{text}/, @response.body
end
end
end