# Copyright (c) 2014 Perforce Software, Inc. All rights reserved. require 'rspec' require 'p4_web_api_client' require_relative 'test_connections' first_job_id = nil RSpec.describe P4WebApiClient::Client, '#create_job' do it 'should create a new job - and return it via #jobs' do client_as_jdoe do |c| new_job = { 'User' => 'jdoe', 'Description' => 'Get to work!' } c.create_job(new_job) jobs = c.jobs expect(jobs.first['Description'].strip).to eq('Get to work!') first_job_id = jobs.first['Job'] end end end RSpec.describe P4WebApiClient::Client, '#job' do it 'should load a single job created via #create_job' do client_as_jdoe do |c| loaded = c.job(first_job_id) expect(loaded['Description'].strip).to eq('Get to work!') end end end RSpec.describe P4WebApiClient::Client, '#update_job' do it "'should be able to change status'" do client_as_jdoe do |c| job = c.job(first_job_id) job['Status'] = 'closed' c.update_job(job) loaded = c.job(first_job_id) expect(loaded['Status']).to eq('closed') end end end RSpec.describe P4WebApiClient::Client, '#delete_job' do it "'should be able to delete a job created via #create_job'" do client_as_jdoe do |c| c.delete_job(first_job_id) jobs = c.jobs expect(jobs.map { |b| b['Job'] }).to_not include(first_job_id) end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 13972 | tjuricek |
Removing old microservice implementations. The system is now mostly a monolith. Eventually there will be a websocket service. |
||
#2 | 13474 | tjuricek | Corrected regressions that broke the API and Project services specs. | ||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |