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

Track and record Webhook Events #11434

Merged
merged 7 commits into from
Oct 28, 2021
Merged

Conversation

sebastian-palma
Copy link
Contributor

@sebastian-palma sebastian-palma commented Oct 26, 2021

@viezly
Copy link

viezly bot commented Oct 26, 2021

Changes preview:

Legend:

👀 Review pull request on Viezly

@sebastian-palma sebastian-palma marked this pull request as ready for review October 27, 2021 16:17
sebastian-palma and others added 3 commits October 27, 2021 15:39
Co-authored-by: Damian Legawiec <damian@sparksolutions.co>
Co-authored-by: Damian Legawiec <damian@sparksolutions.co>
before do
allow(subject).to receive(:request).and_return(request_double)
allow(request_double).to receive(:unprocessable_uri?).and_return(true)
allow(request_double).to(
Copy link
Member

Choose a reason for hiding this comment

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

@sebastian-palma rather then testing receiving methods let's test if the record was created and persisted properly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@damianlegawiec this part isn't testing the subject does receive those method calls, but it's stubbing the respective values for the events creation, which is checked here. As those values depend on the result of performing a HTTP request the whole public interface of MakeRequest has been stubbed through the subject. If we don't do that, we'd be testing the internals of MakeRequest, which has its own examples.

@damianlegawiec damianlegawiec merged commit 7ef95a0 into main Oct 28, 2021
@delete-merged-branch delete-merged-branch bot deleted the feature/add-webhooks-event branch October 28, 2021 11:27
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.

2 participants