Class: TurboRspec::Capybara::Matchers::HaveTurboStreamTag
- Inherits:
-
Object
- Object
- TurboRspec::Capybara::Matchers::HaveTurboStreamTag
- Defined in:
- lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb
Instance Method Summary collapse
- #description ⇒ Object
- #does_not_match?(page_or_node) ⇒ Boolean
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(signed_stream_name: nil) ⇒ HaveTurboStreamTag
constructor
A new instance of HaveTurboStreamTag.
- #matches?(page_or_node) ⇒ Boolean
Constructor Details
#initialize(signed_stream_name: nil) ⇒ HaveTurboStreamTag
Returns a new instance of HaveTurboStreamTag.
7 8 9 |
# File 'lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb', line 7 def initialize(signed_stream_name: nil) @signed_stream_name = signed_stream_name end |
Instance Method Details
#description ⇒ Object
29 30 31 |
# File 'lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb', line 29 def description "have turbo-stream-source#{stream_description}" end |
#does_not_match?(page_or_node) ⇒ Boolean
16 17 18 19 |
# File 'lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb', line 16 def does_not_match?(page_or_node) selector = build_selector page_or_node.has_no_css?(selector, wait: 0) end |
#failure_message ⇒ Object
21 22 23 |
# File 'lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb', line 21 def "expected page to have a turbo-stream-source element#{stream_description}" end |
#failure_message_when_negated ⇒ Object
25 26 27 |
# File 'lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb', line 25 def "expected page not to have a turbo-stream-source element#{stream_description}" end |
#matches?(page_or_node) ⇒ Boolean
11 12 13 14 |
# File 'lib/turbo_rspec/capybara/matchers/have_turbo_stream_tag.rb', line 11 def matches?(page_or_node) selector = build_selector page_or_node.has_css?(selector, wait: 0) end |