From 418e840f4f81d3e4985376e792ef4947d43cd9ce Mon Sep 17 00:00:00 2001 From: Molly Trombley-McCann Date: Fri, 15 Nov 2024 10:26:34 -0800 Subject: [PATCH] Base form and evidence tests extracted --- .../decision_review/sc_status_updater_job.rb | 4 ++-- .../sc_status_updater_job_spec.rb | 18 ------------------ .../shared_examples_for_status_updater_jobs.rb | 10 +++++----- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/app/sidekiq/decision_review/sc_status_updater_job.rb b/app/sidekiq/decision_review/sc_status_updater_job.rb index 1c55781c030..0082bdb2768 100644 --- a/app/sidekiq/decision_review/sc_status_updater_job.rb +++ b/app/sidekiq/decision_review/sc_status_updater_job.rb @@ -26,8 +26,8 @@ def get_record_status(guid) decision_review_service.get_supplemental_claim(guid).body end - def get_evidence_status(uuid) - decision_review_service.get_supplemental_claim_upload(uuid:).body + def get_evidence_status(guid) + decision_review_service.get_supplemental_claim_upload(guid:).body end def evidence? diff --git a/spec/sidekiq/decision_review/sc_status_updater_job_spec.rb b/spec/sidekiq/decision_review/sc_status_updater_job_spec.rb index 156a4e6ec14..c7e680eb377 100644 --- a/spec/sidekiq/decision_review/sc_status_updater_job_spec.rb +++ b/spec/sidekiq/decision_review/sc_status_updater_job_spec.rb @@ -9,24 +9,6 @@ include_context 'status updater job context', SavedClaim::SupplementalClaim - let(:upload_response_vbms) do - response = JSON.parse(File.read('spec/fixtures/supplemental_claims/SC_upload_show_response_200.json')) - instance_double(Faraday::Response, body: response) - end - - let(:upload_response_processing) do - response = JSON.parse(File.read('spec/fixtures/supplemental_claims/SC_upload_show_response_200.json')) - response['data']['attributes']['status'] = 'processing' - instance_double(Faraday::Response, body: response) - end - - let(:upload_response_error) do - response = JSON.parse(File.read('spec/fixtures/supplemental_claims/SC_upload_show_response_200.json')) - response['data']['attributes']['status'] = 'error' - response['data']['attributes']['detail'] = 'Invalid PDF' - instance_double(Faraday::Response, body: response) - end - describe 'perform' do context 'with flag enabled', :aggregate_failures do before do diff --git a/spec/sidekiq/decision_review/shared_examples_for_status_updater_jobs.rb b/spec/sidekiq/decision_review/shared_examples_for_status_updater_jobs.rb index 1c4f6d1dfd7..ed98a64748b 100644 --- a/spec/sidekiq/decision_review/shared_examples_for_status_updater_jobs.rb +++ b/spec/sidekiq/decision_review/shared_examples_for_status_updater_jobs.rb @@ -205,7 +205,7 @@ instance_double(Faraday::Response, body: response) end - let(:evidence_service_method) { SUBCLASS_INFO[subclass][:evidence_service_method].to_sym} + let(:evidence_service_method) { SUBCLASS_INFO[subclass][:evidence_service_method].to_sym } context 'SavedClaim records are present with completed status in LH and have associated evidence uploads' do let(:upload_id) { SecureRandom.uuid } @@ -234,13 +234,13 @@ it 'only sets delete_date for subclass with all attachments in vbms status' do expect(service).to receive(evidence_service_method).with(guid: upload_id) - .and_return(upload_response_vbms) + .and_return(upload_response_vbms) expect(service).to receive(evidence_service_method).with(guid: upload_id2) - .and_return(upload_response_processing) + .and_return(upload_response_processing) expect(service).to receive(evidence_service_method).with(guid: upload_id3) - .and_return(upload_response_vbms) + .and_return(upload_response_vbms) expect(service).to receive(evidence_service_method).with(guid: upload_id4) - .and_return(upload_response_processing) + .and_return(upload_response_processing) expect(service).to receive(service_method).with(guid1).and_return(response_complete) expect(service).to receive(service_method).with(guid2).and_return(response_complete)