@@ -234,15 +234,15 @@ func TestCheckOTP(t *testing.T) {
234234
235235 // Check it again. Should be deleted.
236236 r = testRequest (t , http .MethodPost , "/api/otp/" + dummyOTPID , cp , & data )
237- assert .NotEqual (t , http .StatusOK , r .StatusCode , "OTP didn't get deleted on verification" )
237+ assert .Equal (t , http .StatusGone , r .StatusCode , "OTP didn't get deleted on verification" )
238238
239- // Check non-existent OTP, should not return 200 .
239+ // Check non-existent OTP, should return 410 Gone .
240240 r = testRequest (t , http .MethodPost , "/api/otp/abc123" , cp , & data )
241- assert .NotEqual (t , http .StatusOK , r .StatusCode , "non-existent OTP didn't return 400 " )
241+ assert .Equal (t , http .StatusGone , r .StatusCode , "non-existent OTP didn't return 410 " )
242242
243243 // Check non-existent OTP, should return store.ErrNotExist error message.
244244 _ = testRequest (t , http .MethodPost , "/api/otp/abc123" , cp , & out )
245- assert .Equal (t , "the OTP does not exist" , out .Message , "non-existent OTP passed" )
245+ assert .Equal (t , "OTP has expired or doesn't exist" , out .Message , "non-existent OTP passed" )
246246}
247247
248248func TestCheckOTPAttempts (t * testing.T ) {
0 commit comments