Skip to content
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

Fix bug in Claiming introduced in acd210de08 #946

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

solebared
Copy link
Collaborator

Why

Fixes a bug in peer-to-peer claims.

What

acd210d introduced a bug where Organization was added as a required argument to EmailPeer, but not
supplied by ClaimContribution and ClaimsController.

Testing

This bug went uncaught because claim_contribution_spec was mocking EmailPeer. Changing the spec to let ClaimContribution call composite interactions as it normally would surfaces any such integration problems.

Next Steps

?

Outstanding Questions, Concerns and Other Notes

?

Pre-Merge Checklist

  • Security & accessibility have been considered
  • Tests have been added, or an explanation has been given why the features cannot be tested
  • Documentation and comments have been added to the codebase where required
  • Entry added to CHANGELOG.md if appropriate
  • Outstanding questions and concerns have been resolved
  • Any next steps have been turned into Issues or Discussions as appropriate

Organization was added as a required argument to EmailPeer, but not
supplied by ClaimContribution and ClaimsController.

This went uncaught because claim_contribution_spec was mocking
EmailPeer. Changed in this commit to let ClaimContribution call
composite interactions as it normally would.
peer_alias: 'alias',
message: 'message',
)
end

it "matches contribution and sends an email to peer", :aggregate_failures do
expect(MatchContribution).to have_received(:run!)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use this elsewhere?

Copy link
Collaborator Author

@solebared solebared Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean MatchContribution? EmailPeer?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the first, but was wondering re both while reviewing from my phone. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! If you're asking about testing, this example is replaced by the two below and changed from being mocked to checking the side-effects of MatchContribution and EmailPeer.

As for production code, both are only used in ClaimContribution.

@solebared solebared merged commit a72a1bd into main Apr 28, 2021
@solebared solebared deleted the fix-claim-contribution-param-mismatch branch April 28, 2021 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants