Skip to content

Commit

Permalink
update unsubmit to remove ed references on applicants (#4546)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymhari authored Sep 20, 2024
1 parent 6fd94f0 commit dcf2f4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,11 @@ def build_eligibility_determinations

def delete_eligibility_determinations
eligibility_determinations.destroy_all
applicants.each do |applicant|
applicant.eligibility_determination_id = nil
applicant.tax_filer_kind = nil
end
self.save!
end

def create_evidences
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,14 @@
it 'should transition application to renewal_draft' do
expect(application.reload.renewal_draft?).to be_truthy
end

it 'applicants should not have eligibility determination references' do
expect(application.applicants.pluck(:eligibility_determination_id).uniq).to eq [nil]
end

it 'applicants should not have tax_filer_kind' do
expect(application.applicants.pluck(:tax_filer_kind).uniq).to eq [nil]
end
end

context 'guard failure' do
Expand Down

0 comments on commit dcf2f4a

Please sign in to comment.