# Copyright (c) 2014-2015 Perforce Software, Inc. All rights reserved. require_relative './test_config' require 'helix_web_services_client' RSpec.describe 'HelixWebServicesClient protections' do context '#protections' do it 'should return an array with at least two protections' do client_as_super do |c| p = c.protections expect(p.protections.length).to be >= 2 end end end context '#update_protections' do entry = 'super user jdoe * //...' it 'should add a protections entry for the user jdoe' do client_as_super do |c| p = c.protections p.protections << entry c.update_protections(p) loaded = c.protections expect(loaded.protections).to include(entry) end end it 'should remove the protections entry for user jdoe' do client_as_super do |c| p = c.protections p.protections.delete(entry) c.update_protections(p) loaded = c.protections expect(loaded.protections).to_not include(entry) end end end end