summaryrefslogtreecommitdiffstats
path: root/manualtesting
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-22 12:54:27 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-09-22 13:54:27 -0400
commitdcf9e96a0b16530549168a7891ed8242663b5f28 (patch)
tree344255f0abbe1bd207e2f2ab864d245e240f4eeb /manualtesting
parente0d5703f721aafef1b55747cd09629860e86bfb4 (diff)
downloadchat-dcf9e96a0b16530549168a7891ed8242663b5f28.tar.gz
chat-dcf9e96a0b16530549168a7891ed8242663b5f28.tar.bz2
chat-dcf9e96a0b16530549168a7891ed8242663b5f28.zip
remove global refs from api/api4 (#7496)
Diffstat (limited to 'manualtesting')
-rw-r--r--manualtesting/manual_testing.go8
-rw-r--r--manualtesting/test_autolink.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/manualtesting/manual_testing.go b/manualtesting/manual_testing.go
index dc5674edd..33cf94cbf 100644
--- a/manualtesting/manual_testing.go
+++ b/manualtesting/manual_testing.go
@@ -28,8 +28,8 @@ type TestEnvironment struct {
Request *http.Request
}
-func InitManualTesting() {
- app.Global().Srv.Router.Handle("/manualtest", api.AppHandler(manualTest)).Methods("GET")
+func Init(api3 *api.API) {
+ api3.BaseRoutes.Root.Handle("/manualtest", api3.AppHandler(manualTest)).Methods("GET")
}
func manualTest(c *api.Context, w http.ResponseWriter, r *http.Request) {
@@ -153,9 +153,9 @@ func manualTest(c *api.Context, w http.ResponseWriter, r *http.Request) {
}
}
-func getChannelID(channelname string, teamid string, userid string) (id string, err bool) {
+func getChannelID(a *app.App, channelname string, teamid string, userid string) (id string, err bool) {
// Grab all the channels
- result := <-app.Global().Srv.Store.Channel().GetChannels(teamid, userid)
+ result := <-a.Srv.Store.Channel().GetChannels(teamid, userid)
if result.Err != nil {
l4g.Debug(utils.T("manaultesting.get_channel_id.unable.debug"))
return "", false
diff --git a/manualtesting/test_autolink.go b/manualtesting/test_autolink.go
index 2e5f9c6e7..2614a9e4b 100644
--- a/manualtesting/test_autolink.go
+++ b/manualtesting/test_autolink.go
@@ -24,7 +24,7 @@ https://medium.com/@slackhq/11-useful-tips-for-getting-the-most-of-slack-5dfb3d1
func testAutoLink(env TestEnvironment) *model.AppError {
l4g.Info(utils.T("manaultesting.test_autolink.info"))
- channelID, err := getChannelID(model.DEFAULT_CHANNEL, env.CreatedTeamId, env.CreatedUserId)
+ channelID, err := getChannelID(env.Context.App, model.DEFAULT_CHANNEL, env.CreatedTeamId, env.CreatedUserId)
if err != true {
return model.NewAppError("/manualtest", "manaultesting.test_autolink.unable.app_error", nil, "", http.StatusInternalServerError)
}