From 1db62cabb3913cce8f408b515faab8984e5b4d22 Mon Sep 17 00:00:00 2001 From: Paul-Yves Date: Thu, 21 Nov 2024 10:11:23 +0100 Subject: [PATCH] add spec to cover append_association nil case --- spec/lib/hubspot/utils_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/lib/hubspot/utils_spec.rb b/spec/lib/hubspot/utils_spec.rb index 08d141dc..d4ac4734 100644 --- a/spec/lib/hubspot/utils_spec.rb +++ b/spec/lib/hubspot/utils_spec.rb @@ -143,5 +143,13 @@ } ) end + + context 'when no associated_id' do + it 'does not change the list' do + associations_hash = { 'associations' => [] } + described_class.append_association(associations_hash['associations'], 'Ticket', 'Company', nil) + expect(associations_hash).to eq({ 'associations' => [] }) + end + end end end