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
path: root/qa/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-06 03:09:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-06 03:09:14 +0300
commitc93374099a04d318af464f5b3a54a8aafdbca81f (patch)
tree9e4296521eb85a95a90d058982c30b922836eaa7 /qa/spec
parent1bc5af76617026dec53016cb0881ec834ccab807 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r--qa/spec/spec_helper.rb1
-rw-r--r--qa/spec/support/matchers/have_file.rb13
2 files changed, 14 insertions, 0 deletions
diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb
index 81730c3ab13..ff7717f1d1f 100644
--- a/qa/spec/spec_helper.rb
+++ b/qa/spec/spec_helper.rb
@@ -14,6 +14,7 @@ QA::Runtime::Browser.configure!
QA::Runtime::Scenario.from_env(QA::Runtime::Env.runtime_scenario_attributes) if QA::Runtime::Env.runtime_scenario_attributes
Dir[::File.join(__dir__, "support/helpers/*.rb")].sort.each { |f| require f }
+Dir[::File.join(__dir__, "support/matchers/*.rb")].sort.each { |f| require f }
Dir[::File.join(__dir__, "support/shared_contexts/*.rb")].sort.each { |f| require f }
Dir[::File.join(__dir__, "support/shared_examples/*.rb")].sort.each { |f| require f }
diff --git a/qa/spec/support/matchers/have_file.rb b/qa/spec/support/matchers/have_file.rb
new file mode 100644
index 00000000000..c2bbf134e76
--- /dev/null
+++ b/qa/spec/support/matchers/have_file.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module HaveFileMatcher
+ 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