module StimulusReflex::TestCase::Behavior

Public Instance Methods

build_reflex(opts = {}) click to toggle source
# File lib/stimulus_reflex/test_case.rb, line 30
def build_reflex(opts = {})
  channel = opts.fetch(:channel, TestChannel.new(opts.fetch(:connection, {})))
  element = opts.fetch(:element, StimulusReflex::Element.new)

  self.class.reflex_class.new(
    channel, element: element, url: opts.fetch(:url, ""), method_name: opts.dig(:method_name), params: opts.fetch(:params, {})
  )
end