web/webtest: fix close testserver without mailer
continuous-integration/drone the build was successful
Details
continuous-integration/drone the build was successful
Details
This commit is contained in:
parent
b3f53011f2
commit
3fd1eac4d8
|
@ -64,16 +64,15 @@ func NewWithDBSetup(modules web.ModuleRegisterFunc, dbCall func(db *database.Dat
|
|||
// New allows to configure WebService for testing
|
||||
func (option Option) New() (*TestServer, error) {
|
||||
|
||||
// api setup
|
||||
gin.EnableJsonDecoderDisallowUnknownFields()
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
ws := &web.Service{}
|
||||
ws.Session.Name = "mysession"
|
||||
ws.Session.Secret = "hidden"
|
||||
|
||||
ts := &TestServer{
|
||||
WS: ws,
|
||||
Close: func() {},
|
||||
}
|
||||
|
||||
// db setup
|
||||
if option.Database {
|
||||
ts.DB = &database.Database{
|
||||
|
@ -110,6 +109,11 @@ func (option Option) New() (*TestServer, error) {
|
|||
ts.Close = mock.Close
|
||||
}
|
||||
|
||||
// api setup
|
||||
|
||||
gin.EnableJsonDecoderDisallowUnknownFields()
|
||||
gin.SetMode(gin.TestMode)
|
||||
|
||||
ws.ModuleRegister(option.ModuleLoader)
|
||||
|
||||
r := gin.Default()
|
||||
|
|
Loading…
Reference in New Issue