# 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_branch' do it 'should create a new branch - and return it via #branches' do client_as_jdoe do |c| new_branch = P4WebApiClient::Models::Branch.new new_branch.branch = 'new_branch' new_branch.description = 'Something for the kids' new_branch.view = ['//depot/dev/kids/... //depot/main/kids/...'] c.create_branch(new_branch) branches = c.branches expect(branches.map(&:branch)).to include('new_branch') end end end RSpec.describe P4WebApiClient::Client, '#branch' do it 'should load a single branch created via #create_branch' do client_as_jdoe do |c| new_branch = c.branch('new_branch') expect(new_branch.description.strip).to eq('Something for the kids') expect(new_branch.view.length).to eq(1) expected_view = '//depot/dev/kids/... //depot/main/kids/...' expect(new_branch.view.first).to eq(expected_view) end end end RSpec.describe P4WebApiClient::Client, '#update_branch' do it "'should be able to update the branch description'" do client_as_jdoe do |c| new_branch = c.branch('new_branch') new_branch.description = 'updated' c.update_branch(new_branch) loaded = c.branch('new_branch') expect(loaded.description.strip).to eq('updated') end end end RSpec.describe P4WebApiClient::Client, '#delete_branch' do it "'should be able to delete a branch created via #create_branch'" do client_as_jdoe do |c| c.delete_branch('new_branch') branches = c.branches expect(branches.map(&:branch)).to_not include('new_branch') 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. |