Skip to content

Commit

Permalink
fixed delete_date model to use datetime instead of date
Browse files Browse the repository at this point in the history
  • Loading branch information
samcoforma committed Dec 6, 2024
1 parent 3ec9e21 commit c045838
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 28 deletions.
2 changes: 1 addition & 1 deletion db/migrate/20240925160219_create_evidence_submissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,16 @@
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
pending_es.save!
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
Expand Down

0 comments on commit c045838

Please sign in to comment.