instance method assert_not_in_body

Ruby on Rails 8.1.2

Since v8.1.2

Signature

assert_not_in_body(text)

Asserts that the given +text+ is not present anywhere in the response body.

assert_not_in_body fixture(:name).description

Parameters

text req
Source
# File actionpack/lib/action_dispatch/testing/assertions/response.rb, line 84
      def assert_not_in_body(text)
        assert_no_match(/#{Regexp.escape(text)}/, @response.body)
      end

Defined in actionpack/lib/action_dispatch/testing/assertions/response.rb line 84 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionDispatch::Assertions::ResponseAssertions

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close