module Turbo module TestAssertions extend ActiveSupport::Concern included do # FIXME: Should happen in Rails at a different level delegate :dom_id, :dom_class, to: ActionView::RecordIdentifier end # Assert that the rendered fragment of HTML contains a `` # 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 calling dom_id # * :targets [String] matches the element's [targets] # attribute # * :count [Integer] indicates how many turbo streams are expected. # Defaults to 1. # # Given the following HTML fragment: # # # # The following assertion would pass: # # assert_turbo_stream action: "remove", target: "message_1" # # You can also pass a block make assertions about the contents of the # element. Given the following HTML fragment: # # #