Submit customer identity proofs and show reviewed limits
This commit is contained in:
1 parent
7bf8b8087a
commit
1354551ae8
50 files changed
+1777
-67
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package identityhttp
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
merrors "git.sendico.io/tech/sxchnge/shared/errors"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func TestThrottleDoesNotBecomeGenericUnavailable(t *testing.T) {
|
||||
h := router{logger: zap.NewNop()}
|
||||
w := httptest.NewRecorder()
|
||||
r := httptest.NewRequest("POST", "/accounts/identity", nil)
|
||||
h.result(nil, merrors.WithThrottle(merrors.ErrServiceUnavailable, "identity", 120*time.Second, "temporary limit"))(w, r)
|
||||
require.Equal(t, 429, w.Code)
|
||||
require.Equal(t, "120", w.Header().Get("Retry-After"))
|
||||
}
|
||||
Reference in new issue
Block a user