Module: Dommy::Rails::RSpec::Matchers
- Included in:
- Integration
- Defined in:
- lib/dommy/rails/rspec/matchers.rb
Defined Under Namespace
Classes: HaveAuthenticityToken, HaveCheckableField, HaveCsrfMetaTags, HaveForm, HaveHtmlLink, HaveHtmlText, HaveLink, HaveMeta, HaveNoDuplicateIds, HaveNoEmptyLinks, HaveNoInvalidAriaReferences, HaveNoMissingFormLabels, HaveNoNestedInteractiveElements, HavePlainText, HaveSelect, HaveStimulusAction, HaveStimulusController, HaveStimulusTarget, HaveStimulusValue, HaveTitle, HaveTurboFrame, HaveTurboStream, HaveXPath, MatchAriaSnapshot
Instance Method Summary
collapse
-
#append_turbo_stream(target) ⇒ Object
-
#have_authenticity_token ⇒ Object
-
#have_checked_field(name = nil) ⇒ Object
-
#have_csrf_meta_tags ⇒ Object
-
#have_form(action: nil, method: nil, model: nil) ⇒ Object
-
#have_html_link(text = nil, href: nil, count: nil) ⇒ Object
-
#have_html_text(text) ⇒ Object
-
#have_link(text = nil, href: nil, count: nil) ⇒ Object
-
#have_meta(name: nil, property: nil, content: nil) ⇒ Object
-
#have_no_duplicate_ids ⇒ Object
-
#have_no_empty_links ⇒ Object
-
#have_no_invalid_aria_references ⇒ Object
-
#have_no_missing_form_labels ⇒ Object
-
#have_no_nested_interactive_elements ⇒ Object
-
#have_plain_text(text) ⇒ Object
-
#have_select(name = nil, label: nil, count: nil) ⇒ Object
-
#have_stimulus_action(action) ⇒ Object
-
#have_stimulus_controller(name) ⇒ Object
-
#have_stimulus_target(controller, target) ⇒ Object
-
#have_stimulus_value(controller, key, value) ⇒ Object
-
#have_title(expected) ⇒ Object
-
#have_turbo_frame(id = nil, text: nil, count: nil) ⇒ Object
-
#have_turbo_stream(action:, target:) ⇒ Object
-
#have_unchecked_field(name = nil) ⇒ Object
-
#have_xpath(expression, text: nil, count: nil) ⇒ Object
-
#match_aria_snapshot(expected) ⇒ Object
-
#remove_turbo_stream(target) ⇒ Object
-
#replace_turbo_stream(target) ⇒ Object
-
#update_turbo_stream(target) ⇒ Object
Instance Method Details
#append_turbo_stream(target) ⇒ Object
59
60
61
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 59
def append_turbo_stream(target)
HaveTurboStream.new(action: "append", target: target)
end
|
#have_authenticity_token ⇒ Object
31
32
33
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 31
def have_authenticity_token
HaveAuthenticityToken.new
end
|
#have_checked_field(name = nil) ⇒ Object
47
48
49
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 47
def have_checked_field(name = nil)
HaveCheckableField.new(name, checked: true)
end
|
27
28
29
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 27
def have_csrf_meta_tags
HaveCsrfMetaTags.new
end
|
7
8
9
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 7
def have_form(action: nil, method: nil, model: nil)
HaveForm.new(action: action, method: method, model: model)
end
|
#have_html_link(text = nil, href: nil, count: nil) ⇒ Object
111
112
113
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 111
def have_html_link(text = nil, href: nil, count: nil)
HaveHtmlLink.new(text, href: href, count: count)
end
|
#have_html_text(text) ⇒ Object
115
116
117
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 115
def have_html_text(text)
HaveHtmlText.new(text)
end
|
#have_link(text = nil, href: nil, count: nil) ⇒ Object
35
36
37
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 35
def have_link(text = nil, href: nil, count: nil)
HaveLink.new(text, href: href, count: count)
end
|
23
24
25
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 23
def have_meta(name: nil, property: nil, content: nil)
HaveMeta.new(name: name, property: property, content: content)
end
|
#have_no_duplicate_ids ⇒ Object
91
92
93
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 91
def have_no_duplicate_ids
HaveNoDuplicateIds.new
end
|
#have_no_empty_links ⇒ Object
103
104
105
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 103
def have_no_empty_links
HaveNoEmptyLinks.new
end
|
#have_no_invalid_aria_references ⇒ Object
99
100
101
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 99
def have_no_missing_form_labels
HaveNoMissingFormLabels.new
end
|
#have_no_nested_interactive_elements ⇒ Object
#have_plain_text(text) ⇒ Object
119
120
121
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 119
def have_plain_text(text)
HavePlainText.new(text)
end
|
#have_select(name = nil, label: nil, count: nil) ⇒ Object
43
44
45
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 43
def have_select(name = nil, label: nil, count: nil)
HaveSelect.new(name, label: label, count: count)
end
|
#have_stimulus_action(action) ⇒ Object
79
80
81
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 79
def have_stimulus_action(action)
HaveStimulusAction.new(action)
end
|
#have_stimulus_controller(name) ⇒ Object
75
76
77
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 75
def have_stimulus_controller(name)
HaveStimulusController.new(name)
end
|
#have_stimulus_target(controller, target) ⇒ Object
83
84
85
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 83
def have_stimulus_target(controller, target)
HaveStimulusTarget.new(controller, target)
end
|
#have_stimulus_value(controller, key, value) ⇒ Object
87
88
89
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 87
def have_stimulus_value(controller, key, value)
HaveStimulusValue.new(controller, key, value)
end
|
#have_title(expected) ⇒ Object
15
16
17
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 15
def have_title(expected)
HaveTitle.new(expected)
end
|
#have_turbo_frame(id = nil, text: nil, count: nil) ⇒ Object
39
40
41
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 39
def have_turbo_frame(id = nil, text: nil, count: nil)
HaveTurboFrame.new(id, text: text, count: count)
end
|
#have_turbo_stream(action:, target:) ⇒ Object
55
56
57
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 55
def have_turbo_stream(action:, target:)
HaveTurboStream.new(action: action, target: target)
end
|
#have_unchecked_field(name = nil) ⇒ Object
51
52
53
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 51
def have_unchecked_field(name = nil)
HaveCheckableField.new(name, checked: false)
end
|
#have_xpath(expression, text: nil, count: nil) ⇒ Object
11
12
13
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 11
def have_xpath(expression, text: nil, count: nil)
HaveXPath.new(expression, text: text, count: count)
end
|
#match_aria_snapshot(expected) ⇒ Object
19
20
21
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 19
def match_aria_snapshot(expected)
MatchAriaSnapshot.new(expected)
end
|
#remove_turbo_stream(target) ⇒ Object
71
72
73
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 71
def remove_turbo_stream(target)
HaveTurboStream.new(action: "remove", target: target)
end
|
#replace_turbo_stream(target) ⇒ Object
63
64
65
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 63
def replace_turbo_stream(target)
HaveTurboStream.new(action: "replace", target: target)
end
|
#update_turbo_stream(target) ⇒ Object
67
68
69
|
# File 'lib/dommy/rails/rspec/matchers.rb', line 67
def update_turbo_stream(target)
HaveTurboStream.new(action: "update", target: target)
end
|