LG-8645 – Rename GetUspsProofingResultsJob method and improve tests#8365
LG-8645 – Rename GetUspsProofingResultsJob method and improve tests#8365tomas-nava merged 5 commits intomainfrom
Conversation
changelog: Internal, Refactor, Refactor GetUspsProofingResultsJob & spec
| email_type:, | ||
| enrollment_status:, |
There was a problem hiding this comment.
I added email_type as a new parameter and renamed status to enrollment_status
| before(:each) do | ||
| stub_request_passed_proofing_results | ||
| end |
There was a problem hiding this comment.
this stub was causing only 'passed' emails to be sent, no matter what the test calling this shared example had configured
| email_type: anything, | ||
| email_type: email_type, |
There was a problem hiding this comment.
now that we're no longer always sending 'passed' emails, we can expect a specific email_type
| job.perform(Time.zone.now) | ||
| if email_type == 'deadline passed' | ||
| expect(job_analytics).to have_logged_event( | ||
| 'GetUspsProofingResultsJob: deadline passed email initiated', |
There was a problem hiding this comment.
expired enrollments trigger sending of a completely different type of email; now that we're no longer always sending 'passed' emails, we can test specifically for them
| expect(job_analytics).to have_logged_event( | ||
| 'GetUspsProofingResultsJob: Success or failure email initiated', | ||
| email_type: 'Failed', | ||
| enrollment_code: pending_enrollment.enrollment_code, | ||
| service_provider: anything, | ||
| timestamp: anything, | ||
| wait_until: nil, | ||
| ) |
There was a problem hiding this comment.
this expectation was redundant with the 'enrollment_with_a_status_update' shared example above
| analytics(user: enrollment.user).idv_in_person_usps_proofing_results_job_email_initiated( | ||
| **email_analytics_attributes(enrollment), | ||
| email_type: 'Failed', | ||
| email_type: 'Failed unsupported secondary ID', |
There was a problem hiding this comment.
my one thought with this is that there isn't really a separate version of the failed email for unsupported ids. We have a standard failure email (which is the one we're sending in this case) and a failure b/c of suspected fraud.
There was a problem hiding this comment.
yeah, I was hesitant at first, but noticed that we log 'Failed unsupported ID type' in handle_unsupported_id_type above, and think this message would be useful for filtering when searching logs.
There was a problem hiding this comment.
ok that makes sense to me then
There was a problem hiding this comment.
Since this event is established, it'd be good to first confirm there has been a discussion w/ product to check if they currently have dashboards or reports that would need to be adjusted for the updated value.
🎫 Ticket
related to LG-8645
🛠 Summary of changes
Small refactor to rename a method in GetUspsProofingResultsJob and improve tests for the class.