instance method
assert_in_body
Ruby on Rails 8.1.2
Since v8.1.2Signature
assert_in_body(text)
Asserts that the given +text+ is present somewhere in the response body.
assert_in_body fixture(:name).description
Parameters
-
textreq
Source
# File actionpack/lib/action_dispatch/testing/assertions/response.rb, line 77
def assert_in_body(text)
assert_match(/#{Regexp.escape(text)}/, @response.body)
end
Defined in actionpack/lib/action_dispatch/testing/assertions/response.rb line 77
· View on GitHub
· Improve this page
· Find usages on GitHub