2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Matchers
|
|
|
|
PREDICATE_TARGETS = %w[
|
|
|
|
element
|
|
|
|
file_content
|
|
|
|
assignee
|
|
|
|
child_pipeline
|
|
|
|
content
|
|
|
|
design
|
|
|
|
file
|
|
|
|
issue
|
|
|
|
job
|
|
|
|
package
|
|
|
|
pipeline
|
|
|
|
related_issue_item
|
|
|
|
snippet_description
|
2021-04-17 20:07:23 +05:30
|
|
|
tag
|
2021-03-11 19:13:27 +05:30
|
|
|
].each do |predicate|
|
|
|
|
RSpec::Matchers.define "have_#{predicate}" do |*args, **kwargs|
|
|
|
|
match do |page_object|
|
|
|
|
page_object.public_send("has_#{predicate}?", *args, **kwargs) # rubocop:disable GitlabSecurity/PublicSend
|
|
|
|
end
|
|
|
|
|
|
|
|
match_when_negated do |page_object|
|
|
|
|
page_object.public_send("has_no_#{predicate}?", *args, **kwargs) # rubocop:disable GitlabSecurity/PublicSend
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|