summaryrefslogtreecommitdiff
path: root/qa/qa/resource/base.rb
diff options
context:
space:
mode:
authorTomislav Nikic <tnikic@gitlab.com>2019-09-10 23:20:23 +0000
committerMark Lapierre <mlapierre@gitlab.com>2019-09-10 23:20:23 +0000
commit1ada89d5f1f975418e60e70b5f887da273072f1d (patch)
tree35daf17b21cd5ad2f81eabb71eeb78ef571f68f2 /qa/qa/resource/base.rb
parent564d78dac1960366fb2a4d3f8db53eafe96618ab (diff)
downloadgitlab-ce-1ada89d5f1f975418e60e70b5f887da273072f1d.tar.gz
Backport for EE 15582
This is a back-port for all CE related files.
Diffstat (limited to 'qa/qa/resource/base.rb')
-rw-r--r--qa/qa/resource/base.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/qa/qa/resource/base.rb b/qa/qa/resource/base.rb
index 283fc6cdbcb..88069df6ade 100644
--- a/qa/qa/resource/base.rb
+++ b/qa/qa/resource/base.rb
@@ -47,6 +47,18 @@ module QA
end
end
+ def self.remove_via_api!(*args, &prepare_block)
+ options = args.extract_options!
+ resource = options.fetch(:resource) { new }
+ parents = options.fetch(:parents) { [] }
+
+ resource.eager_load_api_client!
+
+ do_fabricate!(resource: resource, prepare_block: prepare_block, parents: parents) do
+ log_fabrication(:api, resource, parents, args) { resource.remove_via_api! }
+ end
+ end
+
def fabricate!(*_args)
raise NotImplementedError
end