Commit e415855c authored by Felipe Artur's avatar Felipe Artur

Check if user is in project page before performing a push

parent 77c9632e
...@@ -5,6 +5,9 @@ module QA ...@@ -5,6 +5,9 @@ module QA
module Gitlab module Gitlab
module Repository module Repository
class Push < Scenario::Template class Push < Scenario::Template
PAGE_REGEX_CHECK =
%r{\/#{Runtime::Namespace.sandbox_name}\/qa-test[^\/]+\/{1}[^\/]+\z}.freeze
attr_writer :file_name, attr_writer :file_name,
:file_content, :file_content,
:commit_message, :commit_message,
...@@ -20,6 +23,10 @@ module QA ...@@ -20,6 +23,10 @@ module QA
def perform def perform
Git::Repository.perform do |repository| Git::Repository.perform do |repository|
repository.location = Page::Project::Show.act do 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 choose_repository_clone_http
repository_location repository_location
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment