You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-06-17 00:17:59 +02:00
fixed test web-api:TestUserToken from validation change
This commit is contained in:
@ -1378,7 +1378,7 @@ func TestUserToken(t *testing.T) {
|
|||||||
|
|
||||||
// Test user token with empty credentials.
|
// Test user token with empty credentials.
|
||||||
{
|
{
|
||||||
expectedStatus := http.StatusUnauthorized
|
expectedStatus := http.StatusBadRequest
|
||||||
|
|
||||||
rt := requestTest{
|
rt := requestTest{
|
||||||
fmt.Sprintf("Token %d using empty request", expectedStatus),
|
fmt.Sprintf("Token %d using empty request", expectedStatus),
|
||||||
@ -1406,8 +1406,24 @@ func TestUserToken(t *testing.T) {
|
|||||||
|
|
||||||
expected := weberror.ErrorResponse{
|
expected := weberror.ErrorResponse{
|
||||||
StatusCode: expectedStatus,
|
StatusCode: expectedStatus,
|
||||||
Error: http.StatusText(expectedStatus),
|
Error: "Field validation error",
|
||||||
Details: "must provide email and password in Basic auth",
|
Fields: []weberror.FieldError{
|
||||||
|
{
|
||||||
|
Field: "username",
|
||||||
|
Value: "",
|
||||||
|
Tag: "required",
|
||||||
|
Error: "username is a required field",
|
||||||
|
Display: "username is a required field",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Field: "password",
|
||||||
|
Value: "",
|
||||||
|
Tag: "required",
|
||||||
|
Error: "password is a required field",
|
||||||
|
Display: "password is a required field",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Details: actual.Details,
|
||||||
StackTrace: actual.StackTrace,
|
StackTrace: actual.StackTrace,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user