diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-11-02 17:32:28 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-11-05 22:20:57 +0800 |
commit | 4d0fd75cd5ceda72692a229d27ab6891fa8082e0 (patch) | |
tree | 7448b28ca974c9480e1e96b0d90c1322eeb9f0c7 /qa/qa/resource/repository/project_push.rb | |
parent | c12a4a9ac7c04a215adf6062fec7bf31231c7d4a (diff) | |
download | gitlab-ce-4d0fd75cd5ceda72692a229d27ab6891fa8082e0.tar.gz |
Rename QA::Factory to QA::Resource53224-rename-to-resource-base-qa
* Factory::Base -> Resource::Base, and therefore:
* Factory::Resource::Project -> Resource::Project
Diffstat (limited to 'qa/qa/resource/repository/project_push.rb')
-rw-r--r-- | qa/qa/resource/repository/project_push.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/qa/qa/resource/repository/project_push.rb b/qa/qa/resource/repository/project_push.rb new file mode 100644 index 00000000000..c9fafe3419f --- /dev/null +++ b/qa/qa/resource/repository/project_push.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module QA + module Resource + module Repository + class ProjectPush < Repository::Push + attribute :project do + Project.fabricate! do |resource| + resource.name = 'project-with-code' + resource.description = 'Project with repository' + end + end + + def initialize + @file_name = 'file.txt' + @file_content = '# This is test project' + @commit_message = "This is a test commit" + @branch_name = 'master' + @new_branch = true + end + + def repository_http_uri + @repository_http_uri ||= begin + project.visit! + Page::Project::Show.act do + choose_repository_clone_http + repository_location.uri + end + end + end + + def repository_ssh_uri + @repository_ssh_uri ||= begin + project.visit! + Page::Project::Show.act do + choose_repository_clone_ssh + repository_location.uri + end + end + end + end + end + end +end |