From 7049d0bdd6046a2bcac60719d2dfec8576552b06 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Mon, 15 May 2023 15:21:10 +0100 Subject: [PATCH] refactor: how_fix -> how_to_fix --- app/mailers/bulk_upload_mailer.rb | 6 +++--- app/services/bulk_upload/processor.rb | 6 +++--- spec/services/bulk_upload/processor_spec.rb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/mailers/bulk_upload_mailer.rb b/app/mailers/bulk_upload_mailer.rb index c6e59b15e..f74729a0a 100644 --- a/app/mailers/bulk_upload_mailer.rb +++ b/app/mailers/bulk_upload_mailer.rb @@ -5,16 +5,16 @@ class BulkUploadMailer < NotifyMailer FAILED_CSV_ERRORS_TEMPLATE_ID = "e27abcd4-5295-48c2-b127-e9ee4b781b75".freeze FAILED_FILE_SETUP_ERROR_TEMPLATE_ID = "24c9f4c7-96ad-470a-ba31-eb51b7cbafd9".freeze FAILED_SERVICE_ERROR_TEMPLATE_ID = "c3f6288c-7a74-4e77-99ee-6c4a0f6e125a".freeze - HOW_FIX_UPLOAD_TEMPLATE_ID = "21a07b26-f625-4846-9f4d-39e30937aa24".freeze + HOW_TO_FIX_UPLOAD_TEMPLATE_ID = "21a07b26-f625-4846-9f4d-39e30937aa24".freeze - def send_how_fix_upload_mail(bulk_upload:) + def send_how_to_fix_upload_mail(bulk_upload:) title = "We found #{pluralize(bulk_upload.bulk_upload_errors.count, 'error')} in your bulk upload" description = "There was a problem with your #{bulk_upload.year_combo} #{bulk_upload.log_type} data. Check the error report below to fix these errors." cta_link = bulk_upload.sales? ? start_bulk_upload_sales_resume_url(bulk_upload) : start_bulk_upload_lettings_resume_url(bulk_upload) send_email( bulk_upload.user.email, - HOW_FIX_UPLOAD_TEMPLATE_ID, + HOW_TO_FIX_UPLOAD_TEMPLATE_ID, { title:, filename: bulk_upload.filename, diff --git a/app/services/bulk_upload/processor.rb b/app/services/bulk_upload/processor.rb index 66c6b9d10..050bae736 100644 --- a/app/services/bulk_upload/processor.rb +++ b/app/services/bulk_upload/processor.rb @@ -19,7 +19,7 @@ class BulkUpload::Processor create_logs if created_logs_but_incompleted? - send_how_fix_upload_mail + send_how_to_fix_upload_mail elsif created_logs_and_all_completed? bulk_upload.unpend send_success_mail @@ -40,9 +40,9 @@ class BulkUpload::Processor private - def send_how_fix_upload_mail + def send_how_to_fix_upload_mail BulkUploadMailer - .send_how_fix_upload_mail(bulk_upload:) + .send_how_to_fix_upload_mail(bulk_upload:) .deliver_later end diff --git a/spec/services/bulk_upload/processor_spec.rb b/spec/services/bulk_upload/processor_spec.rb index 0c9d50be8..99bc66908 100644 --- a/spec/services/bulk_upload/processor_spec.rb +++ b/spec/services/bulk_upload/processor_spec.rb @@ -224,14 +224,14 @@ RSpec.describe BulkUpload::Processor do expect { processor.call }.to change(LettingsLog.pending, :count).by(1) end - it "sends how_fix_upload_mail" do + it "sends how_to_fix_upload_mail" do mail_double = instance_double("ActionMailer::MessageDelivery", deliver_later: nil) - allow(BulkUploadMailer).to receive(:send_how_fix_upload_mail).and_return(mail_double) + allow(BulkUploadMailer).to receive(:send_how_to_fix_upload_mail).and_return(mail_double) processor.call - expect(BulkUploadMailer).to have_received(:send_how_fix_upload_mail) + expect(BulkUploadMailer).to have_received(:send_how_to_fix_upload_mail) expect(mail_double).to have_received(:deliver_later) end end