Module: TurboRspec::Capybara::Matchers

Defined in:
lib/turbo_rspec/capybara/matchers.rb,
lib/turbo_rspec/capybara/matchers/have_turbo_frame.rb,
lib/turbo_rspec/capybara/matchers/have_stimulus_action.rb,
lib/turbo_rspec/capybara/matchers/have_stimulus_target.rb,
lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb,
lib/turbo_rspec/capybara/matchers/have_stimulus_controller.rb

Defined Under Namespace

Classes: HaveStimulusAction, HaveStimulusController, HaveStimulusTarget, HaveTurboFrame, HaveTurboStreamTag

Instance Method Summary collapse

Instance Method Details

#have_stimulus_action(action_descriptor) ⇒ Object



24
25
26
# File 'lib/turbo_rspec/capybara/matchers.rb', line 24

def have_stimulus_action(action_descriptor)
  HaveStimulusAction.new(action_descriptor)
end

#have_stimulus_controller(controller_name) ⇒ Object



20
21
22
# File 'lib/turbo_rspec/capybara/matchers.rb', line 20

def have_stimulus_controller(controller_name)
  HaveStimulusController.new(controller_name)
end

#have_stimulus_target(controller_name, target_name) ⇒ Object



28
29
30
# File 'lib/turbo_rspec/capybara/matchers.rb', line 28

def have_stimulus_target(controller_name, target_name)
  HaveStimulusTarget.new(controller_name, target_name)
end

#have_turbo_frame(id) ⇒ Object



12
13
14
# File 'lib/turbo_rspec/capybara/matchers.rb', line 12

def have_turbo_frame(id)
  HaveTurboFrame.new(id)
end

#have_turbo_stream_tag(signed_stream_name = nil) ⇒ Object



16
17
18
# File 'lib/turbo_rspec/capybara/matchers.rb', line 16

def have_turbo_stream_tag(signed_stream_name = nil)
  HaveTurboStreamTag.new(signed_stream_name: signed_stream_name)
end

#within_turbo_frame(id, &block) ⇒ Object

:nocov:



33
34
35
# File 'lib/turbo_rspec/capybara/matchers.rb', line 33

def within_turbo_frame(id, &block)
  page.within("turbo-frame##{id}", &block)
end