mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-23 23:55:02 +01:00
Feature: integration testing
Add integration tests with testify/suite. Moved some structs outside of controller funcs so we can re-use them in the testing package. Add CI workflow for running tests on every push.
This commit is contained in:
@@ -16,6 +16,11 @@ func NewCreateUserController(svc *service.LndhubService) *CreateUserController {
|
||||
return &CreateUserController{svc: svc}
|
||||
}
|
||||
|
||||
type CreateUserResponseBody struct {
|
||||
Login string `json:"login"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
// CreateUser : Create user Controller
|
||||
func (controller *CreateUserController) CreateUser(c echo.Context) error {
|
||||
// optional parameters that we currently do not use
|
||||
@@ -34,10 +39,7 @@ func (controller *CreateUserController) CreateUser(c echo.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
var ResponseBody struct {
|
||||
Login string `json:"login"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
var ResponseBody CreateUserResponseBody
|
||||
ResponseBody.Login = user.Login
|
||||
ResponseBody.Password = user.Password
|
||||
|
||||
|
||||
Reference in New Issue
Block a user