summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-04-20 23:22:58 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-04-20 23:22:58 +0800
commit5dfab4ce27cbcfed3c0210b5733bb30fc6a32851 (patch)
treeb2b1210b96bd34a61d9e6b5925d3695fd0bf1a0b
parentfb758c75f200f1dbde80258aefb17cfd471f8749 (diff)
downloadgitlab-ce-5dfab4ce27cbcfed3c0210b5733bb30fc6a32851.tar.gz
Unify the use of repository_location
-rw-r--r--qa/qa/factory/repository/push.rb2
-rw-r--r--qa/qa/factory/resource/project.rb4
-rw-r--r--qa/qa/page/project/show.rb8
-rw-r--r--qa/qa/specs/features/project/deploy_key_clone_spec.rb6
-rw-r--r--qa/qa/specs/features/repository/clone_spec.rb2
5 files changed, 9 insertions, 13 deletions
diff --git a/qa/qa/factory/repository/push.rb b/qa/qa/factory/repository/push.rb
index bd4dee4c7be..a091ae119b3 100644
--- a/qa/qa/factory/repository/push.rb
+++ b/qa/qa/factory/repository/push.rb
@@ -23,7 +23,7 @@ module QA
Git::Repository.perform do |repository|
repository.location = Page::Project::Show.act do
choose_repository_clone_http
- repository_location
+ repository_location.git_uri
end
repository.use_default_credentials
diff --git a/qa/qa/factory/resource/project.rb b/qa/qa/factory/resource/project.rb
index 857d8c98626..cda1b35ba6a 100644
--- a/qa/qa/factory/resource/project.rb
+++ b/qa/qa/factory/resource/project.rb
@@ -17,10 +17,10 @@ module QA
Page::Project::Show.act { project_name }
end
- product :repository_ssh_uri do
+ product :repository_ssh_location do
Page::Project::Show.act do
choose_repository_clone_ssh
- repository_location_uri
+ repository_location
end
end
diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb
index 0c7ad46d36b..261acb10a7a 100644
--- a/qa/qa/page/project/show.rb
+++ b/qa/qa/page/project/show.rb
@@ -33,11 +33,7 @@ module QA
end
def repository_location
- find('#project_clone').value
- end
-
- def repository_location_uri
- Git::Location.new(repository_location)
+ Git::Location.new(find('#project_clone').value)
end
def project_name
@@ -74,7 +70,7 @@ module QA
end
# Ensure git clone textbox was updated
- repository_location.include?(detect_text)
+ repository_location.git_uri.include?(detect_text)
end
end
end
diff --git a/qa/qa/specs/features/project/deploy_key_clone_spec.rb b/qa/qa/specs/features/project/deploy_key_clone_spec.rb
index 42588d1181d..98ea86bf75e 100644
--- a/qa/qa/specs/features/project/deploy_key_clone_spec.rb
+++ b/qa/qa/specs/features/project/deploy_key_clone_spec.rb
@@ -16,7 +16,7 @@ module QA
resource.name = 'deploy-key-clone-project'
end
- @repository_uri = @project.repository_ssh_uri
+ @repository_location = @project.repository_ssh_location
Factory::Resource::Runner.fabricate! do |resource|
resource.project = @project
@@ -60,11 +60,11 @@ module QA
cat-config:
script:
- mkdir -p ~/.ssh
- - ssh-keyscan -p #{@repository_uri.port} #{@repository_uri.host} >> ~/.ssh/known_hosts
+ - ssh-keyscan -p #{@repository_location.port} #{@repository_location.host} >> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- ssh-add -D
- echo "$#{deploy_key_name}" | ssh-add -
- - git clone #{@repository_uri.git_uri}
+ - git clone #{@repository_location.git_uri}
- cd #{@project.name}
- git checkout #{deploy_key_name}
- sha1sum .gitlab-ci.yml
diff --git a/qa/qa/specs/features/repository/clone_spec.rb b/qa/qa/specs/features/repository/clone_spec.rb
index 2adb7524a46..2fc467b1df4 100644
--- a/qa/qa/specs/features/repository/clone_spec.rb
+++ b/qa/qa/specs/features/repository/clone_spec.rb
@@ -4,7 +4,7 @@ module QA
given(:location) do
Page::Project::Show.act do
choose_repository_clone_http
- repository_location
+ repository_location.git_uri
end
end