diff options
Diffstat (limited to 'qa/spec/support')
-rw-r--r-- | qa/spec/support/matchers/have_assignee.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_child_pipeline.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_content.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_design.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_element.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_file.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_file_content.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_issue.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_job.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_matcher.rb | 29 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_package.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_pipeline.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_related_issue_item.rb | 15 | ||||
-rw-r--r-- | qa/spec/support/matchers/have_snippet_description.rb | 15 |
14 files changed, 29 insertions, 195 deletions
diff --git a/qa/spec/support/matchers/have_assignee.rb b/qa/spec/support/matchers/have_assignee.rb deleted file mode 100644 index 5e7aa2162b2..00000000000 --- a/qa/spec/support/matchers/have_assignee.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveAssignee - RSpec::Matchers.define :have_assignee do |assignee| - match do |page_object| - page_object.has_assignee?(assignee) - end - - match_when_negated do |page_object| - page_object.has_no_assignee?(assignee) - end - end - end -end diff --git a/qa/spec/support/matchers/have_child_pipeline.rb b/qa/spec/support/matchers/have_child_pipeline.rb deleted file mode 100644 index d05d9d4209a..00000000000 --- a/qa/spec/support/matchers/have_child_pipeline.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveChildPipeline - RSpec::Matchers.define :have_child_pipeline do - match do |page_object| - page_object.has_child_pipeline? - end - - match_when_negated do |page_object| - page_object.has_no_child_pipeline? - end - end - end -end diff --git a/qa/spec/support/matchers/have_content.rb b/qa/spec/support/matchers/have_content.rb deleted file mode 100644 index 66b30b3b6e4..00000000000 --- a/qa/spec/support/matchers/have_content.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveContent - RSpec::Matchers.define :have_content do |content| - match do |page_object| - page_object.has_content?(content) - end - - match_when_negated do |page_object| - page_object.has_no_content?(content) - end - end - end -end diff --git a/qa/spec/support/matchers/have_design.rb b/qa/spec/support/matchers/have_design.rb deleted file mode 100644 index 85f1367297a..00000000000 --- a/qa/spec/support/matchers/have_design.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveDesign - RSpec::Matchers.define :have_design do |design| - match do |page_object| - page_object.has_design?(design) - end - - match_when_negated do |page_object| - page_object.has_no_design?(design) - end - end - end -end diff --git a/qa/spec/support/matchers/have_element.rb b/qa/spec/support/matchers/have_element.rb deleted file mode 100644 index bf74a78a3b5..00000000000 --- a/qa/spec/support/matchers/have_element.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveElement - RSpec::Matchers.define :have_element do |element, **kwargs| - match do |page_object| - page_object.has_element?(element, **kwargs) - end - - match_when_negated do |page_object| - page_object.has_no_element?(element, **kwargs) - end - end - end -end diff --git a/qa/spec/support/matchers/have_file.rb b/qa/spec/support/matchers/have_file.rb deleted file mode 100644 index 2ae295d5ca2..00000000000 --- a/qa/spec/support/matchers/have_file.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveFile - RSpec::Matchers.define :have_file do |file| - match do |page_object| - page_object.has_file?(file) - end - - match_when_negated do |page_object| - page_object.has_no_file?(file) - end - end - end -end diff --git a/qa/spec/support/matchers/have_file_content.rb b/qa/spec/support/matchers/have_file_content.rb deleted file mode 100644 index e42ece6d59e..00000000000 --- a/qa/spec/support/matchers/have_file_content.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveFileContent - RSpec::Matchers.define :have_file_content do |file_content, file_number| - match do |page_object| - page_object.has_file_content?(file_content, file_number) - end - - match_when_negated do |page_object| - page_object.has_no_file_content?(file_content, file_number) - end - end - end -end diff --git a/qa/spec/support/matchers/have_issue.rb b/qa/spec/support/matchers/have_issue.rb deleted file mode 100644 index 7ef30f22726..00000000000 --- a/qa/spec/support/matchers/have_issue.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveIssue - RSpec::Matchers.define :have_issue do |issue| - match do |page_object| - page_object.has_issue?(issue) - end - - match_when_negated do |page_object| - page_object.has_no_issue?(issue) - end - end - end -end diff --git a/qa/spec/support/matchers/have_job.rb b/qa/spec/support/matchers/have_job.rb deleted file mode 100644 index 89829915fce..00000000000 --- a/qa/spec/support/matchers/have_job.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveJob - RSpec::Matchers.define :have_job do |job| - match do |page_object| - page_object.has_job?(job) - end - - match_when_negated do |page_object| - page_object.has_no_job?(job) - end - end - end -end diff --git a/qa/spec/support/matchers/have_matcher.rb b/qa/spec/support/matchers/have_matcher.rb new file mode 100644 index 00000000000..43ae27f8796 --- /dev/null +++ b/qa/spec/support/matchers/have_matcher.rb @@ -0,0 +1,29 @@ +# 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 + ].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 diff --git a/qa/spec/support/matchers/have_package.rb b/qa/spec/support/matchers/have_package.rb deleted file mode 100644 index 86e9bfee4d1..00000000000 --- a/qa/spec/support/matchers/have_package.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HavePackage - RSpec::Matchers.define :have_package do |package| - match do |page_object| - page_object.has_package?(package) - end - - match_when_negated do |page_object| - page_object.has_no_package?(package) - end - end - end -end diff --git a/qa/spec/support/matchers/have_pipeline.rb b/qa/spec/support/matchers/have_pipeline.rb deleted file mode 100644 index 2bfd49d671a..00000000000 --- a/qa/spec/support/matchers/have_pipeline.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HavePipeline - RSpec::Matchers.define :have_pipeline do - match do |page_object| - page_object.has_pipeline? - end - - match_when_negated do |page_object| - page_object.has_no_pipeline? - end - end - end -end diff --git a/qa/spec/support/matchers/have_related_issue_item.rb b/qa/spec/support/matchers/have_related_issue_item.rb deleted file mode 100644 index 89403f2422a..00000000000 --- a/qa/spec/support/matchers/have_related_issue_item.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveRelatedIssueItem - RSpec::Matchers.define :have_related_issue_item do - match do |page_object| - page_object.has_related_issue_item? - end - - match_when_negated do |page_object| - page_object.has_no_related_issue_item? - end - end - end -end diff --git a/qa/spec/support/matchers/have_snippet_description.rb b/qa/spec/support/matchers/have_snippet_description.rb deleted file mode 100644 index 7c407aefc83..00000000000 --- a/qa/spec/support/matchers/have_snippet_description.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module Matchers - module HaveSnippetDescription - RSpec::Matchers.define :have_snippet_description do |description| - match do |page_object| - page_object.has_snippet_description?(description) - end - - match_when_negated do |page_object| - page_object.has_no_snippet_description? - end - end - end -end |