clean up some weirdness in the router (#80)

This commit is contained in:
Tobi Smethurst 2021-07-07 15:46:42 +02:00 committed by GitHub
commit c71e55ecc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 336 additions and 85 deletions

View file

@ -47,6 +47,7 @@ var testModels []interface{} = []interface{}{
&gtsmodel.Emoji{},
&gtsmodel.Instance{},
&gtsmodel.Notification{},
&gtsmodel.RouterSession{},
&oauth.Token{},
&oauth.Client{},
}

View file

@ -18,11 +18,14 @@
package testrig
import "github.com/superseriousbusiness/gotosocial/internal/router"
import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/router"
)
// NewTestRouter returns a Router suitable for testing
func NewTestRouter() router.Router {
r, err := router.New(NewTestConfig(), NewTestLog())
func NewTestRouter(db db.DB) router.Router {
r, err := router.New(NewTestConfig(), db, NewTestLog())
if err != nil {
panic(err)
}