docs: improve webtest
This commit is contained in:
parent
dbedcfa8f6
commit
106ad42e78
|
@ -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",
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue