Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 14:59:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 14:59:07 +0300
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /qa/spec/support
parent4b1de649d0168371549608993deac953eb692019 (diff)
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'qa/spec/support')
-rw-r--r--qa/spec/support/matchers/have_assignee.rb15
-rw-r--r--qa/spec/support/matchers/have_child_pipeline.rb15
-rw-r--r--qa/spec/support/matchers/have_content.rb15
-rw-r--r--qa/spec/support/matchers/have_design.rb15
-rw-r--r--qa/spec/support/matchers/have_element.rb15
-rw-r--r--qa/spec/support/matchers/have_file_content.rb15
-rw-r--r--qa/spec/support/matchers/have_issue.rb15
-rw-r--r--qa/spec/support/matchers/have_job.rb15
-rw-r--r--qa/spec/support/matchers/have_package.rb15
-rw-r--r--qa/spec/support/matchers/have_pipeline.rb15
-rw-r--r--qa/spec/support/matchers/have_related_issue_item.rb15
-rw-r--r--qa/spec/support/matchers/have_snippet_description.rb15
-rw-r--r--qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb13
13 files changed, 190 insertions, 3 deletions
diff --git a/qa/spec/support/matchers/have_assignee.rb b/qa/spec/support/matchers/have_assignee.rb
new file mode 100644
index 00000000000..5e7aa2162b2
--- /dev/null
+++ b/qa/spec/support/matchers/have_assignee.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..d05d9d4209a
--- /dev/null
+++ b/qa/spec/support/matchers/have_child_pipeline.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..66b30b3b6e4
--- /dev/null
+++ b/qa/spec/support/matchers/have_content.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..85f1367297a
--- /dev/null
+++ b/qa/spec/support/matchers/have_design.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..bf74a78a3b5
--- /dev/null
+++ b/qa/spec/support/matchers/have_element.rb
@@ -0,0 +1,15 @@
+# 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_content.rb b/qa/spec/support/matchers/have_file_content.rb
new file mode 100644
index 00000000000..e42ece6d59e
--- /dev/null
+++ b/qa/spec/support/matchers/have_file_content.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..7ef30f22726
--- /dev/null
+++ b/qa/spec/support/matchers/have_issue.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..89829915fce
--- /dev/null
+++ b/qa/spec/support/matchers/have_job.rb
@@ -0,0 +1,15 @@
+# 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_package.rb b/qa/spec/support/matchers/have_package.rb
new file mode 100644
index 00000000000..86e9bfee4d1
--- /dev/null
+++ b/qa/spec/support/matchers/have_package.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..2bfd49d671a
--- /dev/null
+++ b/qa/spec/support/matchers/have_pipeline.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..89403f2422a
--- /dev/null
+++ b/qa/spec/support/matchers/have_related_issue_item.rb
@@ -0,0 +1,15 @@
+# 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
new file mode 100644
index 00000000000..7c407aefc83
--- /dev/null
+++ b/qa/spec/support/matchers/have_snippet_description.rb
@@ -0,0 +1,15 @@
+# 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
diff --git a/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb b/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb
index 610bf8b9e28..40a8be8202a 100644
--- a/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb
+++ b/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb
@@ -30,10 +30,17 @@ module QA
)
end
- # Require approval from code owners on master
- Resource::ProtectedBranch.fabricate! do |protected_branch|
+ # Require approval from code owners on the default branch
+ # The default branch is already protected, and we can't update a protected branch via the API (yet)
+ # so we unprotect it first and then protect it again with the desired parameters
+ Resource::ProtectedBranch.unprotect_via_api! do |protected_branch|
protected_branch.project = project
- protected_branch.branch_name = 'master'
+ protected_branch.branch_name = project.default_branch
+ end
+
+ Resource::ProtectedBranch.fabricate_via_api! do |protected_branch|
+ protected_branch.project = project
+ protected_branch.branch_name = project.default_branch
protected_branch.new_branch = false
protected_branch.require_code_owner_approval = true
end