Skip to content

Commit f74fd56

Browse files
authored
Merge branch 'master' into fix/otp-expiry-handling
2 parents 4fc9071 + 46de072 commit f74fd56

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cmd/otpgateway/handlers_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,9 @@ func TestDeleteOnOTPCheck(t *testing.T) {
322322
assert.Equal(t, http.StatusOK, r.StatusCode, "verification pending")
323323

324324
// Reattempt status check
325-
r = testRequest(t, http.MethodDelete, "/api/otp/"+dummyOTPID+"/status", nil, &data)
326-
assert.Equal(t, http.StatusBadRequest, r.StatusCode, "otp not found")
325+
r = testRequest(t, http.MethodDelete, "/api/otp/"+dummyOTPID+"/status", nil, &out)
326+
assert.Equal(t, http.StatusGone, r.StatusCode, "otp not found returns 410")
327+
assert.Equal(t, "OTP has expired or doesn't exist", out.Message, "deleted OTP passed")
327328
}
328329

329330
func testRequest(t *testing.T, method, path string, p url.Values, out interface{}) *http.Response {

0 commit comments

Comments
 (0)