-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: correcting spelling error for middleware test function
- Loading branch information
Showing
1 changed file
with
6 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,14 +127,16 @@ func TestProtectedRouteNonMatchingSessionEmailAndToken(t *testing.T) { | |
token2, _, _ := authenticator.GenerateToken("[email protected]", constants.Basic) | ||
|
||
w1 := httptest.NewRecorder() | ||
req1, _ := http.NewRequest("GET", "/ping-auth", nil) | ||
req1.AddCookie(&http.Cookie{Name: "token", Value: token2}) | ||
|
||
// clear previous cookie | ||
req.Header.Del("Cookie") | ||
req.AddCookie(&http.Cookie{Name: "token", Value: token2}) | ||
|
||
// make second request with different email and token | ||
r.ServeHTTP(w1, req1) | ||
r.ServeHTTP(w1, req) | ||
|
||
assert.Equal(t, http.StatusUnauthorized, w1.Code) | ||
assert.Equal(t, "{\"error\":{\"code\":\"INVALID_AUTH\",\"details\":null,\"message\":\"Inalid auth session\"},\"message\":\"Bad Request\",\"status\":401}", w1.Body.String()) | ||
assert.Equal(t, "{\"error\":{\"code\":\"INVALID_AUTH\",\"details\":null,\"message\":\"Invalid auth session\"},\"message\":\"Bad Request\",\"status\":401}", w1.Body.String()) | ||
} | ||
|
||
func TestAdminRoute(t *testing.T) { | ||
|