$:.push File.expand_path("../../lib", __FILE__) require 'helix_web_services_client' require_relative './util/test_config' require_relative './util/string_utils' require 'pp' api = api_as_jdoe rand = random_string job_id = "test-job-#{random_string}" job_command = HelixWebServices::JobCommand.new( Job: job_id, User: 'jdoe', Description: "test #{job_id}", Status: 'open' ) api.server_jobs_post('localhost', job_command) all_jobs = api.server_jobs_get('localhost') unless all_jobs.any? { |b| b.Job == job_id } raise "Did not locate job #{job_id}" end saved_job = api.server_jobs_job_get('localhost', job_id) raise 'job was not saved' if saved_job.Description.strip != job_command.Description.strip to_update = HelixWebServices::JobCommand.new( Status: 'closed' ) api.server_jobs_job_patch('localhost', job_id, to_update) updated = api.server_jobs_job_get('localhost', job_id) raise 'job not updated' if updated.Status != 'closed' api.server_jobs_job_delete('localhost', job_id) all_jobs2 = api.server_jobs_get('localhost') if all_jobs2.any? { |b| b.Job == job_id } raise "Did not delete job #{job_id}" end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/ruby/test/default_api.server_jobs.crud.rb | |||||
#1 | 19198 | tjuricek |
Ruby Client SDK tests, from branches to jobs. Submitting since I've had to alter the Ruby swagger templates, and I want to make sure I haven't lost something. |