diff options
Diffstat (limited to 'qa/qa/resource/job.rb')
-rw-r--r-- | qa/qa/resource/job.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/qa/qa/resource/job.rb b/qa/qa/resource/job.rb new file mode 100644 index 00000000000..96c502e567c --- /dev/null +++ b/qa/qa/resource/job.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module QA + module Resource + class Job < Base + attr_accessor :id, :name, :project + + attributes :id, + :project + + def fabricate_via_api! + resource_web_url(api_get) + rescue ResourceNotFoundError + super + end + + def artifacts + parse_body(api_get_from(api_get_path))[:artifacts] + end + + def api_get_path + "/projects/#{project.id}/jobs/#{id}" + end + + def api_post_path + end + + def api_post_body + { + artifacts: artifacts + } + end + end + end +end |