instance method
assert_no_turbo_stream
Ruby on Rails 2.0.23
Since v1.3.3 Last seen in v2.0.23Signature
assert_no_turbo_stream(action:, target: nil, targets: nil)
Assert that the rendered fragment of HTML does not contain a ‘<turbo-stream>` element.
Options
-
: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 callingdom_id -
:targets[String] matches the element’s[targets]attributeGiven the following HTML fragment:
<turbo-stream action="remove" target="message_1"></turbo-stream>
The following assertion would fail:
assert_no_turbo_stream action: "remove", target: "message_1"
Parameters
-
actionkeyreq -
targetkey = nil -
targetskey = nil
Source
# File lib/turbo/test_assertions.rb, line 76
def assert_no_turbo_stream(action:, target: nil, targets: nil)
selector = %(turbo-stream[action="#{action}"])
selector << %([target="#{target.respond_to?(:to_key) ? dom_id(target) : target}"]) if target
selector << %([targets="#{targets}"]) if targets
assert_select selector, count: 0
end
Defined in lib/turbo/test_assertions.rb line 76
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Turbo::TestAssertions