LG-13738 For Enhanced In-Person Enrollments Only, By-pass Primary ID Type Check in USPS Proofing Results Job#10917
Conversation
…38-By-pass-id-check-in-job-if-EIPP
…imary ID check in USPS proofing results job if Enhanced In-Person Proofing
…38-By-pass-id-check-in-job-if-EIPP
KeithNava
left a comment
There was a problem hiding this comment.
🔥 Amazing testing steps!! 💯
…38-By-pass-id-check-in-job-if-EIPP
eileen-nava
left a comment
There was a problem hiding this comment.
I left some initial comments. This is looking good so far. I'll follow up after I run the testing plan.
| end | ||
|
|
||
| context 'when the enrollment sponsor ID does not equal the EIPP sponsor ID' do | ||
| it 'returns false' do |
There was a problem hiding this comment.
Same as above - I think it makes sense to move this setup out of the it block and into the context block.
You might be able to reduce duplication if you have the user/profile/enrollment setup in the describe block and then define the sponsor_id in the two context blocks.
There was a problem hiding this comment.
eileen-nava
left a comment
There was a problem hiding this comment.
I ran the testing plan and everything passed. Approved.
jennyverdeyen
left a comment
There was a problem hiding this comment.
Tested all the scenarios locally and observed the expected behavior - looks great! 🎉
| trait :with_sponsor_id do | ||
| sponsor_id { '123458' } | ||
| sponsor_id { IdentityConfig.store.usps_ipp_sponsor_id } | ||
| end |
There was a problem hiding this comment.
@eileen-nava Is there a reason I should not use config here and keep a random string?
There was a problem hiding this comment.
I will investigate and get back to you on that question. 👍🏻
There was a problem hiding this comment.
Okay, so here is what I have uncovered by testing:
- If we hard code the number here- enrollments using this bot will always have a sponsor_id
- If we don't hard code the number and use the config store, it will use the value passed into the spec when we mock it like so...
allow(IdentityConfig.store).to receive(:usps_ipp_sponsor_id).and_return(usps_ipp_sponsor_id)
allow(IdentityConfig.store).to receive(:usps_eipp_sponsor_id).and_return(usps_ipp_sponsor_id) - If we don't hard code the number and use the config store, if there is no value passed into the spec it will be nil so sponsor id on enrollment will not be set. It looks like I can set
usps_ipp_sponsor_idin application.yml.default in the test section and then for all of the specs without the mock setup- it will return that value.
I feel like using the config store above and adding a default config in application.yml.default is the best path forward.
UPDATE: I am going to delete your trait because it is no longer being used (and would then be in the in_person_enrollment factory if I add it)
Furthermore I think using the config rather than hard-coding is better. Inside spec/factories/profiles.rb- trait ::letter_sends_rate_limited is using the config store for max_mail_events. I am seeing that config set in config/application.yml.default in the test section.
There was a problem hiding this comment.
It looks like I can set usps_ipp_sponsor_id in application.yml.default in the test section and then for all of the specs without the mock setup- it will return that value.
I agree with this path forward. In response to the UPDATE, I also agree that using the config is better than hardcoding.
…38-By-pass-id-check-in-job-if-EIPP
| association :notification_phone_configuration | ||
| end | ||
|
|
||
| trait :with_sponsor_id do |
There was a problem hiding this comment.
I deleted this trait now that it comes on :in_person_enrollment - see line 8 above
| verify_personal_key_max_attempts: 2 | ||
| usps_ipp_root_url: 'http://localhost:1000' | ||
| usps_ipp_sponsor_id: '111111111111111' | ||
| usps_eipp_sponsor_id: '222222222222222' |
There was a problem hiding this comment.
I added these configs in the test section so that spec/factories/in_person_enrollments.rb will always have a value when they are not set in individual specs
jennyverdeyen
left a comment
There was a problem hiding this comment.
Re-tested all the scenarios and they are all behaving as expected! LGTM
…38-By-pass-id-check-in-job-if-EIPP


🎫 Ticket
LG-13738 By-pass Primary ID Type Check in USPS Proofing Results Job If EIPP
🛠 Summary of changes
📜 Testing Plan
There are 4 tests that you should perform. All 4 must pass. For each test below, there is a description, instructions on how to simulate the scenario, and expected results. The bold shows the differences and should align with that specific test.
Before you start:
enrollment_outcomes[:enrollments_passed] += 1inhandle_successful_status_updateinside app/jobs/get_usps_proofing_results_job.rb is commented outenrollment_outcomes[:enrollments_failed] += 1inhandle_unsupported_id_typeinside app/jobs/get_usps_proofing_results_job.rbTest 1: In-Person Proofing Enrollment || Pass Proofing with Supported ID || Confirm existing behavior is working as expected (ie: Enrollment passes)
enrollment_outcomes[:enrollments_passed] += 1inhandle_successful_status_updateinside app/jobs/get_usps_proofing_results_job.rb is commented outTest 2: In-Person Proofing Enrollment || Pass Proofing with Unsupported ID || Confirm existing behavior is working as expected (ie: Enrollment fails)
enrollment_outcomes[:enrollments_failed] += 1inhandle_unsupported_id_typeinside app/jobs/get_usps_proofing_results_job.rb is commented outTest 3: Enhanced In-Person Proofing Enrollment || Pass Proofing with Supported ID || Confirm existing behavior is working as expected (ie: Enrollment passes)
enrollment_outcomes[:enrollments_passed] += 1inhandle_successful_status_updateinside app/jobs/get_usps_proofing_results_job.rb is commented outTest 4: Enhanced In-Person Proofing Enrollment || Pass Proofing with Unsupported ID || Confirm new behavior is working as expected (ie: Enrollment passes)
enrollment_outcomes[:enrollments_passed] += 1inhandle_successful_status_updateinside app/jobs/get_usps_proofing_results_job.rb is commented out