# Copyright (c) 2014-2015 Perforce Software, Inc. All rights reserved. require_relative './test_config' require 'helix_web_services_client' RSpec.describe HelixWebServicesClient, '#triggers' do it 'should allow us to update and fetch a new example trigger line' do client_as_super do |c| t = c.triggers t.Triggers = [] unless t.Triggers t.triggers << 'cscheck change-submit //depot/... "cmd %changelist%"' c.update_triggers(t) loaded = c.triggers expected_trigger = 'cscheck change-submit //depot/... "cmd %changelist%"' expect(loaded.triggers).to include(expected_trigger) end end it 'should allow us to clear out the triggers table' do client_as_super do |c| triggers = c.triggers triggers.triggers = [] c.update_triggers(triggers) updated = c.triggers expect(updated.triggers).to be(nil) end end end