summaryrefslogtreecommitdiffstats
path: root/api4/file_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-06 17:12:54 -0500
committerGitHub <noreply@github.com>2017-09-06 17:12:54 -0500
commit1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3 (patch)
tree2766bacc1f045fa685ca3d8310cd6174d0311d09 /api4/file_test.go
parentb84bd21089d305333fa4114b95be70f5ad94ad1b (diff)
downloadchat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.gz
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.tar.bz2
chat-1adfd0e9be69a93c7f63bb7afc742c9fafe31aa3.zip
app type transition (#7167)
Diffstat (limited to 'api4/file_test.go')
-rw-r--r--api4/file_test.go12
1 files changed, 6 insertions, 6 deletions
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)
}