Skip to content

Commit

Permalink
Coe prefill changes (#9244)
Browse files Browse the repository at this point in the history
* Coe prefill changes

* removed 2 unused tests

* test fixes

* testing for the right properties

* comma drama

* added phone and email

* this data doesn't need to be nested

* removed unnecessary code

* fixed spec to match model

* fixed the rest of the spec

* removed comments, added end of line

* added back in tests, bumped memoized helper max
  • Loading branch information
alsleaders authored Mar 10, 2022
1 parent 97ffec0 commit e7a2f10
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ RSpec/DescribeClass:
# Offense count: 1416
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 37
Max: 40

# Offense count: 573
RSpec/StubbedMock:
Expand Down
6 changes: 4 additions & 2 deletions app/models/form_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class FormProfile
mdot: ['MDOT'],
fsr: ['5655'],
vre_counseling: ['28-8832'],
vre_readiness: ['28-1900']
vre_readiness: ['28-1900'],
coe: ['26-1880']
}.freeze

FORM_ID_TO_CLASS = {
Expand Down Expand Up @@ -132,7 +133,8 @@ class FormProfile
'5655' => ::FormProfiles::VA5655,
'28-8832' => ::FormProfiles::VA288832,
'28-1900' => ::FormProfiles::VA281900,
'22-1990EZ' => ::FormProfiles::VA1990ez
'22-1990EZ' => ::FormProfiles::VA1990ez,
'26-1880' => ::FormProfiles::VA261880
}.freeze

APT_REGEX = /\S\s+((apt|apartment|unit|ste|suite).+)/i.freeze
Expand Down
11 changes: 11 additions & 0 deletions app/models/form_profiles/va_261880.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class FormProfiles::VA261880 < FormProfile
def metadata
{
version: 0,
prefill: true,
returnUrl: '/applicant-information'
}
end
end
7 changes: 7 additions & 0 deletions config/form_profile_mappings/26-1880.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fullName: [identity_information, full_name]
ssn: [identity_information, ssn]
dob: [identity_information, date_of_birth]
applicantAddress: [contact_information, address]
mainPhone: [contact_information, us_phone]
cellPhone: [contact_information, mobile_phone]
email: [contact_information, email]
3 changes: 3 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ vre_counseling:
vre_readiness:
prefill: true

coe:
prefill: true

# Settings for EVSS
evss:
prefill: true
Expand Down
23 changes: 23 additions & 0 deletions spec/models/form_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,28 @@
}
end

let(:v26_1880_expected) do
{
'fullName' => {
'first' => user.first_name&.capitalize,
'last' => user.last_name&.capitalize,
'suffix' => user.suffix
},
'ssn' => '796111863',
'dob' => '1809-02-12',
'applicantAddress' => {
'street' => street_check[:street],
'street2' => street_check[:street2],
'city' => user.address[:city],
'state' => user.address[:state],
'country' => user.address[:country],
'postal_code' => user.address[:zip][0..4]
},
'mainPhone' => us_phone,
'email' => user.pciu_email
}
end

let(:v28_8832_expected) do
{
'claimantAddress' => {
Expand Down Expand Up @@ -1121,6 +1143,7 @@ def stub_methods_for_emis_data
686C-674
28-8832
28-1900
26-1880
].each do |form_id|
it "returns prefilled #{form_id}" do
expect_prefilled(form_id)
Expand Down

0 comments on commit e7a2f10

Please sign in to comment.