instance method assert_no_turbo_stream

Ruby on Rails 2.0.23

Since v1.5.0 Last seen in v2.0.23

Available in: v1.5.0 v2.0.23

Signature

assert_no_turbo_stream(status: :ok, **attributes)

Assert that the Turbo Stream request’s response body’s HTML does not contain a ‘<turbo-stream>` element.

Options

  • :status [Integer, Symbol] the HTTP response status

  • :action [String] matches the element’s [action] attribute

  • :target [String, #to_key] matches the element’s [target] attribute. If the value responds to #to_key, the value will be transformed by calling dom_id

  • :targets [String] matches the element’s [targets] attribute

    Given the following HTML response body:

    <turbo-stream action="remove" target="message_1"></turbo-stream>

    The following assertion would fail:

    assert_no_turbo_stream action: "remove", target: "message_1"
    

Parameters

status key = :ok
attributes keyrest
Source
# File lib/turbo/test_assertions/integration_test_assertions.rb, line 69
      def assert_no_turbo_stream(status: :ok, **attributes)
        assert_response status
        assert_equal Mime[:turbo_stream], response.media_type
        super(**attributes)
      end

Defined in lib/turbo/test_assertions/integration_test_assertions.rb line 69 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Turbo::TestAssertions::IntegrationTestAssertions

Type at least 2 characters to search.

↑↓ navigate · open · esc close