diff --git a/app/mailers/bulk_upload_mailer.rb b/app/mailers/bulk_upload_mailer.rb index 7ff1dd1c3..3ee2dcd92 100644 --- a/app/mailers/bulk_upload_mailer.rb +++ b/app/mailers/bulk_upload_mailer.rb @@ -5,17 +5,17 @@ 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 CHECK_SOFT_VALIDATIONS_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/models/forms/bulk_upload_lettings_soft_validations_check/soft_errors_valid.rb b/app/models/forms/bulk_upload_lettings_soft_validations_check/soft_errors_valid.rb index b2eee2488..a3f6435d2 100644 --- a/app/models/forms/bulk_upload_lettings_soft_validations_check/soft_errors_valid.rb +++ b/app/models/forms/bulk_upload_lettings_soft_validations_check/soft_errors_valid.rb @@ -18,7 +18,7 @@ module Forms end def view_path - "bulk_upload_lettings_soft_validations_check/soft_errors_valid" + "bulk_upload_lettings_soft_validations_check/valid" end def next_path diff --git a/app/services/bulk_upload/processor.rb b/app/services/bulk_upload/processor.rb index b268aa65c..16d0a067d 100644 --- a/app/services/bulk_upload/processor.rb +++ b/app/services/bulk_upload/processor.rb @@ -21,7 +21,7 @@ class BulkUpload::Processor if validator.soft_validation_errors_only? send_check_soft_validations_mail elsif 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 @@ -46,9 +46,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 1549bee52..6c250bbb6 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 @@ -304,12 +304,12 @@ RSpec.describe BulkUpload::Processor do mail_double = instance_double("ActionMailer::MessageDelivery", deliver_later: nil) allow(BulkUploadMailer).to receive(:send_check_soft_validations_mail).and_return(mail_double) - 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_check_soft_validations_mail) - expect(BulkUploadMailer).not_to have_received(:send_how_fix_upload_mail) + expect(BulkUploadMailer).not_to have_received(:send_how_to_fix_upload_mail) expect(mail_double).to have_received(:deliver_later) end