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

Change the alert specs to use webmock #494

Merged
merged 1 commit into from
Jan 27, 2022
Merged

Change the alert specs to use webmock #494

merged 1 commit into from
Jan 27, 2022

Commits on Jan 26, 2022

  1. 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.
    barrucadu committed Jan 26, 2022
    Configuration menu
    Copy the full SHA
    a384175 View commit details
    Browse the repository at this point in the history