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
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-12-06 20:02:00 +0300
committerFelipe Artur <felipefac@gmail.com>2017-12-07 16:30:32 +0300
commite415855c6a7c97e6540d4776dd880fa5bfbdf0b6 (patch)
tree4a558b4c09102022ead402ddeed0bc8af570d989 /qa
parent77c9632e9cbc9d424934852faf61d8dea322b6d0 (diff)
Check if user is in project page before performing a push
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/scenario/gitlab/repository/push.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/qa/qa/scenario/gitlab/repository/push.rb b/qa/qa/scenario/gitlab/repository/push.rb
index bc5b6307d13..b00ab0c313a 100644
--- a/qa/qa/scenario/gitlab/repository/push.rb
+++ b/qa/qa/scenario/gitlab/repository/push.rb
@@ -5,6 +5,9 @@ module QA
module Gitlab
module Repository
class Push < Scenario::Template
+ PAGE_REGEX_CHECK =
+ %r{\/#{Runtime::Namespace.sandbox_name}\/qa-test[^\/]+\/{1}[^\/]+\z}.freeze
+
attr_writer :file_name,
:file_content,
:commit_message,
@@ -20,6 +23,10 @@ module QA
def perform
Git::Repository.perform do |repository|
repository.location = Page::Project::Show.act do
+ unless PAGE_REGEX_CHECK.match(current_path)
+ raise "To perform this scenario the current page should be project show."
+ end
+
choose_repository_clone_http
repository_location
end