-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the alert specs to use webmock
When implementing the unpublishing alert feature, we merged code with a bug which was passing all the tests. The bug was that we were calling a method in gds-api-adapters with incorrect arguments. This bug passed the tests because the tests do not actually use gds-api-adapters, they mock those methods and check that the mocked methods are called appropriately. This is a problem for two reasons: 1. It let us write code which looked correct and even passed tests, but which could only have been verified as correct by consulting a different repository. 2. An update to gds-api-adapters could change the method signature and our tests would continue to pass on the dependabot branch, even though merging it would break the service. The point of testing is to catch bugs. If a test actively obscures bugs, it should be fixed. This commit fixes the issue by using webmock to check the actual calls we make to email-alert-api, rather than stubbing the methods in gds-api-adapters.
- Loading branch information
Showing
2 changed files
with
72 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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