Skip to content

Commit

Permalink
do not check no for burial responsibility and plot expense responsibi…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
evansmith committed Apr 15, 2024
1 parent 209b1d7 commit a923d64
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions lib/pdf_fill/forms/va21p530v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,10 @@ def merge_fields(_options = {})
# special case: these fields were built as checkboxes instead of radios, so usual radio logic can't be used.
burial_expense_responsibility = @form_data['burialExpenseResponsibility']
@form_data['hasBurialExpenseResponsibility'] = burial_expense_responsibility ? 'On' : nil
@form_data['noBurialExpenseResponsibility'] = burial_expense_responsibility ? nil : 'On'

# special case: these fields were built as checkboxes instead of radios, so usual radio logic can't be used.
plot_expense_responsibility = @form_data['plotExpenseResponsibility']
@form_data['hasPlotExpenseResponsibility'] = plot_expense_responsibility ? 'On' : nil
@form_data['noPlotExpenseResponsibility'] = plot_expense_responsibility ? nil : 'On'

# special case: these fields were built as checkboxes instead of radios, so usual radio logic can't be used.
process_option = @form_data['processOption']
Expand Down
2 changes: 0 additions & 2 deletions spec/fixtures/pdf_fill/21P-530V2/merge_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@
"veteranSocialSecurityNumber3":{"first":"987", "second":"65", "third":"4322"},
"hasTransportation":"YES",
"hasBurialExpenseResponsibility":"On",
"noBurialExpenseResponsibility":null,
"hasPlotExpenseResponsibility":"On",
"noPlotExpenseResponsibility":null,
"hasProcessOption":null,
"noProcessOption":"On",
"hasConfirmation":"YES",
Expand Down
6 changes: 4 additions & 2 deletions spec/lib/pdf_fill/forms/va21p530v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,14 @@ def class_form_data

it 'leaves benefit selections blank on pdf if unselected', run_at: '2024-03-21 00:00:00 EDT' do
unselected_benefits_data = get_fixture('pdf_fill/21P-530V2/kitchen_sink').except(
'burialAllowance', 'plotAllowance', 'transportation'
'burialExpenseResponsibility', 'plotExpenseResponsibility', 'transportation'
)
expected_merge_data = get_fixture('pdf_fill/21P-530V2/merge_fields').except(
'burialAllowance', 'plotAllowance', 'transportation'
'burialExpenseResponsibility', 'plotExpenseResponsibility', 'transportation'
)
expected_merge_data['hasTransportation'] = nil
expected_merge_data['hasBurialExpenseResponsibility'] = nil
expected_merge_data['hasPlotExpenseResponsibility'] = nil
expect(described_class.new(unselected_benefits_data).merge_fields.to_json).to eq(
expected_merge_data.to_json
)
Expand Down

0 comments on commit a923d64

Please sign in to comment.