# Copyright (c) 2014-2015 Perforce Software, Inc. All rights reserved. require 'rspec' require 'helix_web_services_client' require_relative './test_config' RSpec.describe 'HelixWebServicesClient clients' do randstr = (0...8).map { (65 + rand(26)).chr }.join new_client_id = "new_client_#{randstr}" new_client = { 'Client' => new_client_id, 'Description' => 'A client', 'Root' => "/tmp/#{new_client_id}", 'View' => ["//depot/dev/kids/... //#{new_client_id}/dev/kids/..."] } it 'should create a new client - and return it via #clients' do client_as_jdoe do |c| c.create_client(new_client) clients = c.clients expect(clients.map(&:client)).to include(new_client_id) end end it 'should load a single client created via #create_client' do client_as_jdoe do |c| new_client = c.client(new_client_id) expect(new_client.description.strip).to eq('A client') expect(new_client.view.length).to eq(1) expect(new_client.view.first).to eq(new_client['View'].first) end end it "'should be able to update the client description'" do client_as_jdoe do |c| new_client = c.client(new_client_id) new_client.Description = 'updated' c.update_client(new_client) loaded = c.client(new_client_id) expect(loaded.description.strip).to eq('updated') end end it "'should be able to delete a client created via #create_client'" do client_as_jdoe do |c| c.delete_client(new_client_id) clients = c.clients expect(clients.map(&:client)).to_not include(new_client_id) end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client/spec/clients_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/clients_spec.rb | |||||
#1 | 15078 | tjuricek |
clients spec method revisions Updated some other documentation. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec.old/perforce/clients_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/clients_spec.rb | |||||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. |