fix error in report job where nil email array returns false#10577
Merged
fix error in report job where nil email array returns false#10577
Conversation
changelog: Internal, IdV, Fix error Identity report job with empty email array
aduth
approved these changes
May 9, 2024
| save_report(REPORT_NAME, csv, extension: 'csv') | ||
|
|
||
| if emails.empty? | ||
| if emails.compact.empty? |
Contributor
There was a problem hiding this comment.
- I might suggest moving this into the
def emailsmethod itself, since I doubt we'd ever want to deal with a[nil]array from that method - Could we add some regression test coverage for this?
aduth
reviewed
May 10, 2024
| it 'does not send report in email if the email field is empty' do | ||
| allow(IdentityConfig.store).to receive(:team_ada_email).and_return(nil) | ||
|
|
||
| expect(ReportMailer).to_not receive(:tables_report) |
Contributor
There was a problem hiding this comment.
This test passes without the changes. I think we're missing a call to actually perform the job?
Suggested change
| expect(ReportMailer).to_not receive(:tables_report) | |
| expect(ReportMailer).to_not receive(:tables_report) | |
| subject.perform(report_date) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Fix an error in IdentityVerificationReport job where a nil email array returns false when it should return true to not send out the email.