Exclude stale sessions in IAL2 usage query#11528
Merged
Conversation
aduth
approved these changes
Nov 19, 2024
| saml_signature_query | ||
| ].each do |query| | ||
| expect(client).to have_received(:fetch).with( | ||
| query: report.send(query), |
Contributor
There was a problem hiding this comment.
Nit: I think it'd be reasonable to assume (and assert) these methods are part of the class's public API?
Suggested change
| query: report.send(query), | |
| query: report.public_send(query), |
Contributor
Author
There was a problem hiding this comment.
i'm happy to make this update, but am curious about what advantages you see for using public_send? just that it's implicitly asserting that the method is public? (which maybe it actually shouldn't be? but that's overthinking this report code at the moment)
Contributor
There was a problem hiding this comment.
Yeah, my thought process was:
- "Are we calling internal methods in this spec in a way which pierces the abstraction?
- "Oh, no we're not, because those methods are indeed public"
- "So maybe we should add some guarantees that those are indeed public"
- "
public_sendwill loudly fail if they're not public, and would be easy to swap in"
Comment on lines
+125
to
+127
| before do | ||
| allow(client).to receive(:fetch).and_call_original | ||
| end |
Contributor
Author
There was a problem hiding this comment.
yah, it sets up the spy!
Contributor
There was a problem hiding this comment.
Ooh, I misread the setup below as expect(client).to receive, thinking that made this allow redundant.
zachmargolis
approved these changes
Nov 19, 2024
Merged
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.
🎫 Ticket
Link to the relevant ticket:
Fix facial match usage query
🛠 Summary of changes