From 413078af195af64105aacce262779ec09d82d699 Mon Sep 17 00:00:00 2001 From: gabrieljablonski Date: Fri, 2 May 2025 19:57:19 -0300 Subject: [PATCH] chore: apply rubocop --- .../services/internal/accounts/internal_attributes_service.rb | 2 +- .../internal/accounts/internal_attributes_service_spec.rb | 4 ++-- .../crm/leadsquared/mappers/conversation_mapper_spec.rb | 2 +- spec/services/crm/leadsquared/processor_service_spec.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/enterprise/app/services/internal/accounts/internal_attributes_service.rb b/enterprise/app/services/internal/accounts/internal_attributes_service.rb index 7bc69d0a4..b97493dce 100644 --- a/enterprise/app/services/internal/accounts/internal_attributes_service.rb +++ b/enterprise/app/services/internal/accounts/internal_attributes_service.rb @@ -26,7 +26,7 @@ class Internal::Accounts::InternalAttributesService # Update the account account.internal_attributes = new_attrs - account.save + account.save! end # Get manually managed features diff --git a/spec/enterprise/services/internal/accounts/internal_attributes_service_spec.rb b/spec/enterprise/services/internal/accounts/internal_attributes_service_spec.rb index 8411bb823..e2ec89342 100644 --- a/spec/enterprise/services/internal/accounts/internal_attributes_service_spec.rb +++ b/spec/enterprise/services/internal/accounts/internal_attributes_service_spec.rb @@ -42,7 +42,7 @@ RSpec.describe Internal::Accounts::InternalAttributesService do end it 'creates internal_attributes hash if it is empty' do - account.update(internal_attributes: {}) + account.update!(internal_attributes: {}) # Stub the validation to allow our test key allow(service).to receive(:validate_key!).and_return(true) @@ -60,7 +60,7 @@ RSpec.describe Internal::Accounts::InternalAttributesService do end it 'returns the features when they are set' do - account.update(internal_attributes: { 'manually_managed_features' => %w[feature1 feature2] }) + account.update!(internal_attributes: { 'manually_managed_features' => %w[feature1 feature2] }) expect(service.manually_managed_features).to eq(%w[feature1 feature2]) end diff --git a/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb b/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb index 29f7136f1..85bb08d74 100644 --- a/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb +++ b/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb @@ -183,7 +183,7 @@ RSpec.describe Crm::Leadsquared::Mappers::ConversationMapper do expect(result.length).to be <= described_class::ACTIVITY_NOTE_MAX_SIZE + 100 # Verify that not all messages are included (some were truncated) - expect(messages.count).to be > result.scan(/John Doe:/).count + expect(messages.count).to be > result.scan('John Doe:').count end it 'respects the ACTIVITY_NOTE_MAX_SIZE constant' do diff --git a/spec/services/crm/leadsquared/processor_service_spec.rb b/spec/services/crm/leadsquared/processor_service_spec.rb index efdead00b..d51881fdc 100644 --- a/spec/services/crm/leadsquared/processor_service_spec.rb +++ b/spec/services/crm/leadsquared/processor_service_spec.rb @@ -51,7 +51,7 @@ RSpec.describe Crm::Leadsquared::ProcessorService do context 'when contact has no stored lead ID' do before do - contact.update(additional_attributes: { 'external' => nil }) + contact.update!(additional_attributes: { 'external' => nil }) contact.reload allow(lead_client).to receive(:create_or_update_lead)