# Copyright (c) 2014 Perforce Software, Inc. All rights reserved. require 'rspec' require 'p4_web_api_client' require_relative 'test_connections' RSpec.describe P4WebApiClient::Client, '#create_client' do it 'should create a new client - and return it via #clients' do client_as_jdoe do |c| new_client = P4WebApiClient::Models::Client.new new_client.client = 'new_client' new_client.description = 'A client' new_client.root = '/tmp/new_client' new_client.view = ['//depot/dev/kids/... //new_client/dev/kids/...'] c.create_client(new_client) clients = c.clients expect(clients.map(&:client)).to include('new_client') end end end RSpec.describe P4WebApiClient::Client, '#client' do it 'should load a single client created via #create_client' do client_as_jdoe do |c| new_client = c.client('new_client') expect(new_client.description.strip).to eq('A client') expect(new_client.view.length).to eq(1) expected_view = '//depot/dev/kids/... //new_client/dev/kids/...' expect(new_client.view.first).to eq(expected_view) end end end RSpec.describe P4WebApiClient::Client, '#update_client' do it "'should be able to update the client description'" do client_as_jdoe do |c| new_client = c.client('new_client') new_client.description = 'updated' c.update_client(new_client) loaded = c.client('new_client') expect(loaded.description.strip).to eq('updated') end end end RSpec.describe P4WebApiClient::Client, '#delete_client' do it "'should be able to delete a client created via #create_client'" do client_as_jdoe do |c| c.delete_client('new_client') clients = c.clients expect(clients.map(&:client)).to_not include('new_client') 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. |