# 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_stream' do it 'should create a new stream - and return it via #streams' do client_as_jdoe do |c| new_depot = P4WebApiClient::Models::Depot.new new_depot.depot = 'stuffs' new_depot.type = :stream new_depot.map = 'stuffs/...' c.create_depot(new_depot) new_stream = P4WebApiClient::Models::Stream.new new_stream.stream = '//stuffs/new_stream' new_stream.name = 'new_stream' new_stream.description = 'A new stream' new_stream.type = :mainline new_stream.parent = 'none' new_stream.paths = ['share ...'] new_stream.owner = 'jdoe' c.create_stream(new_stream) streams = c.streams expect(streams.map(&:stream)).to include('//stuffs/new_stream') end end end RSpec.describe P4WebApiClient::Client, '#stream' do it 'should load a single stream created via #create_stream' do client_as_jdoe do |c| new_stream = c.stream('//stuffs/new_stream') expect(new_stream.description.strip).to eq('A new stream') expect(new_stream.name).to eq('new_stream') expect(new_stream.type).to eq(:mainline) end end end RSpec.describe P4WebApiClient::Client, '#update_stream' do it "'should be able to update the stream description'" do client_as_jdoe do |c| new_stream = c.stream('//stuffs/new_stream') new_stream.description = 'updated' c.update_stream(new_stream) loaded = c.stream('//stuffs/new_stream') expect(loaded.description.strip).to eq('updated') end end end RSpec.describe P4WebApiClient::Client, '#delete_stream' do it "'should be able to delete a stream created via #create_stream'" do client_as_jdoe do |c| c.delete_stream('//stuffs/new_stream') streams = c.streams expect(streams.map(&:stream_id)).to_not include('//stuffs/new_stream') 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. |