# Copyright (c) 2014-2015 Perforce Software, Inc. All rights reserved. require_relative './test_config' require 'helix_web_services_client' RSpec.describe 'HelixWebServicesClient servers' do randstr = (0...8).map { (65 + rand(26)).chr }.join server_id = "test_#{randstr}" new_server = { 'ServerID' => server_id, 'Description' => "test server #{server_id}", 'Type' => 'server', 'Services' => 'standard' } context '#create_server' do it 'should create a new server - and return it via #servers' do client_as_super do |c| c.create_server(new_server) servers = c.servers expect(servers.map(&:ServerID)).to include(server_id) end end end context '#server' do it 'should load a single server created via #create_server' do client_as_super do |c| new_server = c.server(server_id) expect(new_server.description).to include(new_server['Description']) expect(new_server.type).to eq('server') expect(new_server.services).to include('standard') end end end context '#update_server' do it "'should be able to update the server description'" do client_as_super do |c| new_server = c.server(server_id) new_server.description = "updated #{randstr}" c.update_server(new_server) loaded = c.server(server_id) expect(loaded.description).to include("updated #{randstr}") end end end context '#delete_server' do it "'should be able to delete a server created via #create_server'" do client_as_super do |c| c.delete_server(server_id) servers = c.servers expect(servers.map(&:ServerID)).to_not include(server_id) end 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/servers_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/servers_spec.rb | |||||
#2 | 15223 | tjuricek |
Update the server tests to use super. More behavioral differences between our package installed-p4d config vs the 'just download it and run'. |
||
#1 | 15222 | tjuricek |
Revise server specs testing and documentation. Note: also fixed issues with setting P4PORT via headers. For whatever reason, the host setting doesn't seem to work like I expect it to, though P4PORT works just fine. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec.old/perforce/servers_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/servers_spec.rb | |||||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. |