summaryrefslogtreecommitdiff
path: root/qa/qa/resource
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 15:09:37 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 15:09:37 +0000
commita210c43e0aca0311cc1d3d381763b25979ec72dc (patch)
tree0325d173da7a6e7bd6c2cdf450d0aa1c4e142d0f /qa/qa/resource
parentc9687bdf58e9d4a9c3942f587bd4841f42e3b5de (diff)
downloadgitlab-ce-a210c43e0aca0311cc1d3d381763b25979ec72dc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/resource')
-rw-r--r--qa/qa/resource/ssh_key.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/qa/qa/resource/ssh_key.rb b/qa/qa/resource/ssh_key.rb
index 22bdea424ca..3e130aef9e4 100644
--- a/qa/qa/resource/ssh_key.rb
+++ b/qa/qa/resource/ssh_key.rb
@@ -7,6 +7,8 @@ module QA
attr_accessor :title
+ attribute :id
+
def_delegators :key, :private_key, :public_key, :md5_fingerprint
def key
@@ -21,6 +23,35 @@ module QA
profile_page.add_key(public_key, title)
end
end
+
+ def fabricate_via_api!
+ api_post
+ end
+
+ def api_delete
+ QA::Runtime::Logger.debug("Deleting SSH key with title '#{title}' and fingerprint '#{md5_fingerprint}'")
+
+ super
+ end
+
+ def api_get_path
+ "/user/keys/#{id}"
+ end
+
+ def api_post_path
+ '/user/keys'
+ end
+
+ def api_post_body
+ {
+ title: title,
+ key: public_key
+ }
+ end
+
+ def api_delete_path
+ "/user/keys/#{id}"
+ end
end
end
end