Skip to content

Commit

Permalink
Base form and evidence tests extracted
Browse files Browse the repository at this point in the history
  • Loading branch information
kayline committed Nov 18, 2024
1 parent 228d82c commit 418e840
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
4 changes: 2 additions & 2 deletions app/sidekiq/decision_review/sc_status_updater_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
18 changes: 0 additions & 18 deletions spec/sidekiq/decision_review/sc_status_updater_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 418e840

Please sign in to comment.