-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LG-14175: Expire EIPP enrollments in job #11085
Changes from all commits
35ce06d
04c648c
9ffcdc3
cd40419
e6638c6
8e9a6d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,14 @@ def request_facilities(_location, is_enhanced_ipp) | |
end | ||
end | ||
|
||
def request_proofing_results(_enrollment) | ||
JSON.parse(Fixtures.request_passed_proofing_results_response) | ||
def request_proofing_results(enrollment) | ||
if enrollment.days_to_due_date.negative? && enrollment.enhanced_ipp? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this to support manual testing. Feedback is welcome! Making the manual testing plan took me longer than anticipated. |
||
body = JSON.parse(Fixtures.request_expired_enhanced_ipp_results_response) | ||
response = { body: body, status: 400 } | ||
raise Faraday::BadRequestError.new('Bad request error', response) | ||
else | ||
JSON.parse(Fixtures.request_passed_proofing_results_response) | ||
end | ||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"responseMessage": "More than 7 days have passed since opt-in to IPP" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,7 +366,7 @@ | |
request_in_progress_proofing_results_args, | ||
{ status: 500 }, | ||
request_failed_proofing_results_args, | ||
request_expired_proofing_results_args, | ||
request_expired_id_ipp_results_args, | ||
).and_raise(Faraday::TimeoutError).and_raise(Faraday::ConnectionFailed) | ||
|
||
job.perform(Time.zone.now) | ||
|
@@ -527,7 +527,7 @@ | |
end | ||
|
||
it 'sends deadline passed email on response with expired status' do | ||
stub_request_expired_proofing_results | ||
stub_request_expired_id_ipp_proofing_results | ||
user = pending_enrollment.user | ||
expect(pending_enrollment.deadline_passed_sent).to be false | ||
freeze_time do | ||
|
@@ -851,7 +851,7 @@ | |
|
||
context 'when an enrollment expires' do | ||
before(:each) do | ||
stub_request_expired_proofing_results | ||
stub_request_expired_id_ipp_proofing_results | ||
end | ||
|
||
it_behaves_like( | ||
|
@@ -860,7 +860,7 @@ | |
email_type: 'deadline passed', | ||
enrollment_status: InPersonEnrollment::STATUS_EXPIRED, | ||
response_json: UspsInPersonProofing::Mock::Fixtures. | ||
request_expired_proofing_results_response, | ||
request_expired_id_ipp_results_response, | ||
) | ||
|
||
it 'logs that the enrollment expired' do | ||
|
@@ -1229,7 +1229,7 @@ | |
end | ||
|
||
it 'does not set the fraud related fields of an expired enrollment' do | ||
stub_request_expired_proofing_results | ||
stub_request_expired_id_ipp_proofing_results | ||
|
||
job.perform(Time.zone.now) | ||
profile = pending_enrollment.reload.profile | ||
|
@@ -1354,7 +1354,7 @@ | |
end | ||
|
||
it 'deactivates and sets fraud related fields of an expired enrollment' do | ||
stub_request_expired_proofing_results | ||
stub_request_expired_id_ipp_proofing_results | ||
|
||
job.perform(Time.zone.now) | ||
|
||
|
@@ -1449,7 +1449,7 @@ | |
|
||
context 'enrollment is expired' do | ||
it 'deletes the notification phone configuration without sending an sms' do | ||
stub_request_expired_proofing_results | ||
stub_request_expired_id_ipp_proofing_results | ||
|
||
expect(pending_enrollment.notification_phone_configuration).to_not be_nil | ||
|
||
|
@@ -1531,7 +1531,7 @@ | |
end | ||
|
||
context <<~STR.squish do | ||
When an Enhanced IPP enrollment passess proofing | ||
When an Enhanced IPP enrollment passes proofing | ||
with unsupported ID,enrollment by-passes the | ||
Primary ID check and | ||
STR | ||
|
@@ -1585,7 +1585,7 @@ | |
end | ||
end | ||
|
||
context 'By passes the Secondary ID check when enrollment is Enhanced IPP' do | ||
context 'Bypasses the Secondary ID check when enrollment is Enhanced IPP' do | ||
before do | ||
stub_request_passed_proofing_secondary_id_type_results_ial_2 | ||
end | ||
|
@@ -1600,6 +1600,57 @@ | |
enhanced_ipp_enrollment: true, | ||
) | ||
end | ||
|
||
context 'when an enrollment expires' do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests are looking good! 👍🏻 |
||
before(:each) do | ||
stub_request_expired_enhanced_ipp_proofing_results | ||
end | ||
|
||
it_behaves_like( | ||
'enrollment_with_a_status_update', | ||
passed: false, | ||
email_type: 'deadline passed', | ||
enrollment_status: InPersonEnrollment::STATUS_EXPIRED, | ||
response_json: UspsInPersonProofing::Mock::Fixtures. | ||
request_expired_enhanced_ipp_results_response, | ||
enhanced_ipp_enrollment: true, | ||
) | ||
|
||
it 'logs that the enrollment expired' do | ||
job.perform(Time.zone.now) | ||
|
||
expect(pending_enrollment.proofed_at).to eq(nil) | ||
expect(job_analytics).to have_logged_event( | ||
'GetUspsProofingResultsJob: Enrollment status updated', | ||
hash_including( | ||
reason: 'Enrollment has expired', | ||
job_name: 'GetUspsProofingResultsJob', | ||
enhanced_ipp: true, | ||
), | ||
) | ||
end | ||
|
||
context 'when the in_person_stop_expiring_enrollments flag is true' do | ||
before do | ||
allow(IdentityConfig.store).to( | ||
receive(:in_person_stop_expiring_enrollments).and_return(true), | ||
) | ||
end | ||
|
||
it 'treats the enrollment as incomplete' do | ||
job.perform(Time.zone.now) | ||
|
||
expect(pending_enrollment.status).to eq(InPersonEnrollment::STATUS_PENDING) | ||
expect(job_analytics).to have_logged_event( | ||
'GetUspsProofingResultsJob: Enrollment incomplete', | ||
hash_including( | ||
response_message: 'More than 7 days have passed since opt-in to IPP', | ||
job_name: 'GetUspsProofingResultsJob', | ||
), | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed- no more instances of
request_expired_proofing_results_response
found