diff --git a/db/migrate/20240925160219_create_evidence_submissions.rb b/db/migrate/20240925160219_create_evidence_submissions.rb index 3f8e02222e0..9ea5f930c4c 100644 --- a/db/migrate/20240925160219_create_evidence_submissions.rb +++ b/db/migrate/20240925160219_create_evidence_submissions.rb @@ -12,7 +12,7 @@ def change t.string :upload_status t.string :va_notify_id t.string :va_notify_status - t.date :delete_date + t.datetime :delete_date t.datetime :acknowledgement_date t.datetime :failed_date t.string :error_message diff --git a/spec/factories/lighthouse/benefits_documents/factories/evidence_submission.rb b/spec/factories/lighthouse/benefits_documents/factories/evidence_submission.rb index 7f737842ed5..5885b80b6c8 100644 --- a/spec/factories/lighthouse/benefits_documents/factories/evidence_submission.rb +++ b/spec/factories/lighthouse/benefits_documents/factories/evidence_submission.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'lighthouse/benefits_documents/constants' + FactoryBot.define do factory :bd_evidence_submission, class: 'EvidenceSubmission' do association :user_account, factory: :user_account diff --git a/spec/sidekiq/lighthouse/evidence_submission_document_upload_polling_job_spec.rb b/spec/sidekiq/lighthouse/evidence_submission_document_upload_polling_job_spec.rb index 5e9b9b8db58..e6d4ba515cc 100644 --- a/spec/sidekiq/lighthouse/evidence_submission_document_upload_polling_job_spec.rb +++ b/spec/sidekiq/lighthouse/evidence_submission_document_upload_polling_job_spec.rb @@ -28,30 +28,9 @@ user_account_id: user_account_uuid } end - let(:success_params) do - { - claim_id: 'claim-id3', - tracked_item_id: 'tracked-item-id3', - job_id: job, - job_class: '', - upload_status: BenefitsDocuments::Constants::UPLOAD_STATUS[:SUCCESS], - user_account_id: user_account_uuid - } - end - let(:failed_params) do - { - claim_id: 'claim-id4', - tracked_item_id: 'tracked-item-id4', - job_id: job, - job_class: '', - upload_status: BenefitsDocuments::Constants::UPLOAD_STATUS[:FAILED], - user_account_id: user_account_uuid - } - end context 'When there are EvidenceSubmission records' do before do - # TODO: investigate using factories instead of writing directly to the db in this test allow_any_instance_of(Auth::ClientCredentials::Service).to receive(:get_token).and_return('fake_access_token') pending_es = EvidenceSubmission.find_or_create_by(**pending_params) pending_es.request_id = 1 @@ -59,12 +38,6 @@ pending_es2 = EvidenceSubmission.find_or_create_by(**pending_params2) pending_es2.request_id = 2 pending_es2.save! - success_es = EvidenceSubmission.find_or_create_by(**success_params) - success_es.request_id = 3 - success_es.save! - failed_es = EvidenceSubmission.find_or_create_by(**failed_params) - failed_es.request_id = 4 - failed_es.save! end it 'polls and updates status for each EvidenceSubmission record that is still pending' do