diff options
-rw-r--r-- | qa/qa/resource/ci_variable.rb | 27 | ||||
-rw-r--r-- | qa/qa/resource/project.rb | 1 |
2 files changed, 28 insertions, 0 deletions
diff --git a/qa/qa/resource/ci_variable.rb b/qa/qa/resource/ci_variable.rb index d82de4cb816..341d3c1ed7e 100644 --- a/qa/qa/resource/ci_variable.rb +++ b/qa/qa/resource/ci_variable.rb @@ -25,6 +25,33 @@ module QA end end end + + def fabricate_via_api! + resource_web_url(api_get) + rescue ResourceNotFoundError + super + end + + def resource_web_url(resource) + super + rescue ResourceURLMissingError + # this particular resource does not expose a web_url property + end + + def api_get_path + "/projects/#{project.id}/variables/#{key}" + end + + def api_post_path + "/projects/#{project.id}/variables" + end + + def api_post_body + { + key: key, + value: value + } + end end end end diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb index de1e9f04c36..c1a0cff86d8 100644 --- a/qa/qa/resource/project.rb +++ b/qa/qa/resource/project.rb @@ -7,6 +7,7 @@ module QA class Project < Base include Events::Project + attribute :id attribute :name attribute :description |