Commit 124fb743 by Hugo Häggmark Committed by Leonard Gram

teams: make test cases pass again

parent da3dcd19
...@@ -972,8 +972,12 @@ func postDashboardScenario(desc string, url string, routePattern string, mock *d ...@@ -972,8 +972,12 @@ func postDashboardScenario(desc string, url string, routePattern string, mock *d
Convey(desc+" "+url, func() { Convey(desc+" "+url, func() {
defer bus.ClearBusHandlers() defer bus.ClearBusHandlers()
cfg := setting.NewCfg()
cfg.EditorsCanOwn = false
hs := HTTPServer{ hs := HTTPServer{
Bus: bus.GetBus(), Bus: bus.GetBus(),
Cfg: cfg,
} }
sc := setupScenarioContext(url) sc := setupScenarioContext(url)
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models" m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/setting"
. "github.com/smartystreets/goconvey/convey" . "github.com/smartystreets/goconvey/convey"
) )
...@@ -141,12 +142,20 @@ func createFolderScenario(desc string, url string, routePattern string, mock *fa ...@@ -141,12 +142,20 @@ func createFolderScenario(desc string, url string, routePattern string, mock *fa
Convey(desc+" "+url, func() { Convey(desc+" "+url, func() {
defer bus.ClearBusHandlers() defer bus.ClearBusHandlers()
cfg := setting.NewCfg()
cfg.EditorsCanOwn = false
hs := HTTPServer{
Bus: bus.GetBus(),
Cfg: cfg,
}
sc := setupScenarioContext(url) sc := setupScenarioContext(url)
sc.defaultHandler = Wrap(func(c *m.ReqContext) Response { sc.defaultHandler = Wrap(func(c *m.ReqContext) Response {
sc.context = c sc.context = c
sc.context.SignedInUser = &m.SignedInUser{OrgId: TestOrgID, UserId: TestUserID} sc.context.SignedInUser = &m.SignedInUser{OrgId: TestOrgID, UserId: TestUserID}
return CreateFolder(c, cmd) return hs.CreateFolder(c, cmd)
}) })
origNewFolderService := dashboards.NewFolderService origNewFolderService := dashboards.NewFolderService
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment