Skip to content

Commit

Permalink
[Automated] Merged master into target k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
va-vsp-bot committed Apr 24, 2024
2 parents 6a46b32 + 4f082e5 commit a456140
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 1 deletion.
Expand Up @@ -62,6 +62,7 @@ def translate
output_form.update(translate_veteran)
output_form.update(translate_treatments)
output_form.update(translate_disabilities)
output_form.update(add_toxic_exposure) if Flipper.enabled?(:disability_526_toxic_exposure, @current_user)

@translated_form
end
Expand Down Expand Up @@ -629,6 +630,14 @@ def map_secondary(input_disability, disabilities)
end
end

###
# Toxic Exposure
###

def add_toxic_exposure
{ 'toxicExposure' => input_form['toxicExposure'] }
end

def application_expiration_date
1.year.from_now.iso8601
end
Expand Down
Expand Up @@ -1451,6 +1451,36 @@
end
end

describe '#add_toxic_exposure' do
let(:form_content) do
{
'form526' => {
'toxicExposure' => {
'gulfWar1990' => {
'iraq' => true,
'kuwait' => true,
'qatar' => true
}
}
}
}
end

it 'returns toxic exposure' do
expect(subject.send(:add_toxic_exposure)).to eq(
{
'toxicExposure' => {
'gulfWar1990' => {
'iraq' => true,
'kuwait' => true,
'qatar' => true
}
}
}
)
end
end

describe '#application_expiration_date' do
it 'returns the application creation date + 365 days' do
expect(subject.send(:application_expiration_date)).to eq '2021-11-05T18:19:50Z'
Expand Down
2 changes: 2 additions & 0 deletions spec/requests/disability_compensation_form_request_spec.rb
Expand Up @@ -242,6 +242,8 @@ def test_error(cassette_path, status, headers)
post('/v0/disability_compensation_form/submit_all_claim', params: all_claims_form, headers:)
expect(response).to have_http_status(:ok)
expect(response).to match_response_schema('submit_disability_form')
form = Form526Submission.last.form
expect(form.dig('form526', 'form526', 'toxicExposure')).not_to eq(nil)
end

it 'matches the rated disabilites schema with camel-inflection' do
Expand Down
Expand Up @@ -144,6 +144,7 @@
]
}
],
"toxicExposure": {},
"waiveRetirementPay": false,
"waiveTrainingPay": true,
"hasTrainingPay": true
Expand Down
Expand Up @@ -191,7 +191,69 @@
}
]
}
]
],
"toxicExposure": {
"gulfWar1990": {
"iraq": true,
"kuwait": true,
"qatar": true
},
"gulfWar1990Details": {
"iraq": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"qatar": {
"startDate": "1991-02-12",
"endDate": "1991-06-01"
},
"kuwait": {
"startDate": "1991-03-15"
}
},
"herbicide": {
"cambodia": true,
"guam": true,
"laos": true
},
"herbicideDetails": {
"cambodia": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"guam": {
"startDate": "1991-02-12",
"endDate": "1991-06-01"
},
"laos": {
"startDate": "1991-03-15"
}
},
"otherHerbicideLocations": "freeform text field.",
"otherExposures": {
"asbestos": true,
"radiation": true,
"mustardgas": false
},
"otherExposureDetails": {
"asbestos": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"radiation": {
"startDate": "1991-03-01",
"endDate": "1992-01-01"
}
},
"specifyOtherExposures": {
"description": "Lead, burn pits",
"startDate": "1991-03-01",
"endDate": "1992-01-01"
},
"conditions": {
"deviatedseptum": true
}
}
}
},
"form526_uploads": [
Expand Down

0 comments on commit a456140

Please sign in to comment.