From 1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 6 Sep 2017 17:12:54 -0500 Subject: app type transition (#7167) --- api4/file_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'api4/file_test.go') diff --git a/api4/file_test.go b/api4/file_test.go index 04c0a8569..f08597047 100644 --- a/api4/file_test.go +++ b/api4/file_test.go @@ -51,7 +51,7 @@ func TestUploadFile(t *testing.T) { } var info *model.FileInfo - if result := <-app.Srv.Store.FileInfo().Get(uploadInfo.Id); result.Err != nil { + if result := <-th.App.Srv.Store.FileInfo().Get(uploadInfo.Id); result.Err != nil { t.Fatal(result.Err) } else { info = result.Data.(*model.FileInfo) @@ -317,7 +317,7 @@ func TestGetFileLink(t *testing.T) { CheckBadRequestStatus(t, resp) // Hacky way to assign file to a post (usually would be done by CreatePost call) - store.Must(app.Srv.Store.FileInfo().AttachToPost(fileId, th.BasicPost.Id)) + store.Must(th.App.Srv.Store.FileInfo().AttachToPost(fileId, th.BasicPost.Id)) utils.Cfg.FileSettings.EnablePublicLink = false _, resp = Client.GetFileLink(fileId) @@ -352,7 +352,7 @@ func TestGetFileLink(t *testing.T) { _, resp = th.SystemAdminClient.GetFileLink(fileId) CheckNoError(t, resp) - if result := <-app.Srv.Store.FileInfo().Get(fileId); result.Err != nil { + if result := <-th.App.Srv.Store.FileInfo().Get(fileId); result.Err != nil { t.Fatal(result.Err) } else { cleanupTestFile(result.Data.(*model.FileInfo)) @@ -508,9 +508,9 @@ func TestGetPublicFile(t *testing.T) { } // Hacky way to assign file to a post (usually would be done by CreatePost call) - store.Must(app.Srv.Store.FileInfo().AttachToPost(fileId, th.BasicPost.Id)) + store.Must(th.App.Srv.Store.FileInfo().AttachToPost(fileId, th.BasicPost.Id)) - result := <-app.Srv.Store.FileInfo().Get(fileId) + result := <-th.App.Srv.Store.FileInfo().Get(fileId) info := result.Data.(*model.FileInfo) link := app.GeneratePublicLink(Client.Url, info) @@ -543,7 +543,7 @@ func TestGetPublicFile(t *testing.T) { t.Fatal("should've failed to get image with public link after salt changed") } - if err := cleanupTestFile(store.Must(app.Srv.Store.FileInfo().Get(fileId)).(*model.FileInfo)); err != nil { + if err := cleanupTestFile(store.Must(th.App.Srv.Store.FileInfo().Get(fileId)).(*model.FileInfo)); err != nil { t.Fatal(err) } -- cgit v1.2.3-1-g7c22