teams: make test cases pass again

This commit is contained in:
Hugo Häggmark
2019-03-06 08:09:34 +01:00
committed by Leonard Gram
parent da3dcd1918
commit 124fb743e8
2 changed files with 14 additions and 1 deletions

View File

@@ -972,8 +972,12 @@ func postDashboardScenario(desc string, url string, routePattern string, mock *d
Convey(desc+" "+url, func() {
defer bus.ClearBusHandlers()
cfg := setting.NewCfg()
cfg.EditorsCanOwn = false
hs := HTTPServer{
Bus: bus.GetBus(),
Cfg: cfg,
}
sc := setupScenarioContext(url)

View File

@@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/setting"
. "github.com/smartystreets/goconvey/convey"
)
@@ -141,12 +142,20 @@ func createFolderScenario(desc string, url string, routePattern string, mock *fa
Convey(desc+" "+url, func() {
defer bus.ClearBusHandlers()
cfg := setting.NewCfg()
cfg.EditorsCanOwn = false
hs := HTTPServer{
Bus: bus.GetBus(),
Cfg: cfg,
}
sc := setupScenarioContext(url)
sc.defaultHandler = Wrap(func(c *m.ReqContext) Response {
sc.context = c
sc.context.SignedInUser = &m.SignedInUser{OrgId: TestOrgID, UserId: TestUserID}
return CreateFolder(c, cmd)
return hs.CreateFolder(c, cmd)
})
origNewFolderService := dashboards.NewFolderService