# Copyright (c) 2014-2015 Perforce Software, Inc. All rights reserved. require_relative './test_config' require 'helix_web_services_client' RSpec.describe 'HelixWebServicesClient jobs' do randstr = (0...8).map { (65 + rand(26)).chr }.join job_id = nil new_job = { 'Job' => 'new', 'User' => 'jdoe', 'Description' => "Test Job #{randstr}", 'Status' => 'open' } context '#create_job' do it 'should create a new job - and return it via #jobs' do client_as_jdoe do |c| c.create_job(new_job) jobs = c.jobs job = jobs.find{ |x| x.description.include?(new_job['Description'])} expect(job).to_not be nil job_id = job['Job'] end end end context '#job' do it 'should load a single job created via #create_job' do client_as_jdoe do |c| loaded = c.job(job_id) expect(loaded.description).to include(new_job['Description']) end end end context '#update_job' do it "'should be able to change status'" do client_as_jdoe do |c| job = c.job(job_id) job['Status'] = 'closed' c.update_job(job) loaded = c.job(job_id) expect(loaded.status).to eq('closed') end end end context '#delete_job' do it "'should be able to delete a job created via #create_job'" do client_as_jdoe do |c| c.delete_job(job_id) jobs = c.jobs expect(jobs.map { |b| b['Job'] }).to_not include(job_id) end end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15688 | Doug Scheirer |
Populate -o //guest/perforce_software/helix-web-services/... //guest/doug_scheirer/helix-web-services/.... |
||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/spec/jobs_spec.rb | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec/jobs_spec.rb | |||||
#1 | 15210 | tjuricek | Implement tests and documentation for job spec management. | ||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec.old/perforce/jobs_spec.rb | |||||
#1 | 15053 | tjuricek |
Revise the client API to use the new login method. The current specs will need to be revised since data normalization is moving out of the server and into the client. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec/perforce/jobs_spec.rb | |||||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. |