docs: improve webtest

This commit is contained in:
Geno 2021-06-01 17:49:13 +02:00
parent dbedcfa8f6
commit 106ad42e78
1 changed files with 6 additions and 4 deletions

View File

@ -122,13 +122,15 @@ func (s *testServer) Request(method, url string, body interface{}, expectCode in
} }
} }
func (this *testServer) Login(login Login) { // Login to API by send request
func (s *testServer) Login(login Login) {
// POST: correct login // POST: correct login
this.Request(http.MethodPost, "/api/v1/auth/login", &login, http.StatusOK, nil) s.Request(http.MethodPost, "/api/v1/auth/login", &login, http.StatusOK, nil)
} }
func (this *testServer) TestLogin() { // TestLogin to API by default login data
this.Login(Login{ func (s *testServer) TestLogin() {
s.Login(Login{
Username: "admin", Username: "admin",
Password: "CHANGEME", Password: "CHANGEME",
}) })