# Copyright (c) 2014 Perforce Software, Inc. All rights reserved. require_relative './test_config' require 'helix_web_services_client' RSpec.describe 'HelixWebServicesClient labels' do randstr = (0...8).map { (65 + rand(26)).chr }.join label_id = "test_#{randstr}" new_label = { 'Label' => label_id, 'Description' => "test label #{label_id}", 'View' => ['//depot/...'] } context '#create_label' do it 'should create a new label - and return it via #labels' do client_as_jdoe do |c| c.create_label(new_label) labels = c.labels expect(labels.map(&:label)).to include(label_id) end end end context '#label' do it 'should load a single label created via #create_label' do client_as_jdoe do |c| new_label = c.label(label_id) expect(new_label.description).to include(new_label['Description']) expect(new_label.view.first).to eq('//depot/...') end end end context '#update_label' do it "'should be able to update the label description'" do client_as_jdoe do |c| new_label = c.label(label_id) new_label.description = "Update label #{label_id}" c.update_label(new_label) loaded = c.label(label_id) expect(loaded.description).to include("Update label #{label_id}") end end end context '#delete_label' do it "'should be able to delete a label created via #create_label'" do client_as_jdoe do |c| c.delete_label(label_id) labels = c.labels expect(labels.map(&:label)).to_not include(label_id) end end end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 17274 | tjuricek |
Initial revision of Ruby client API. Removing a bunch of the "helper method aliases" and specs that no longer run. The 2016.1 API will be much more like the Java (and TBD C++) APIs. |
||
#2 | 16280 | tjuricek |
Adjustments for Helix Cloud settings Several tests are now disabled due for Helix Cloud since they won't work on streams, which HC only uses. |
||
#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/labels_spec.rb | |||||
#1 | 15211 | tjuricek | Implement tests and documentation for label spec management. | ||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/spec.old/perforce/labels_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/labels_spec.rb | |||||
#1 | 13808 | tjuricek | Finish converting most of the core p4d API into the new monolithic system. |