From fadd9514f6e71590aba781a7035e1de4150137b0 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 4 Oct 2017 11:42:38 -0400 Subject: PLT-7718 Patch for files (#7564) * Patch for files * Fix merge * Fix tests * Fix another test --- app/file_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/file_test.go') diff --git a/app/file_test.go b/app/file_test.go index 62511ceea..f3141fa18 100644 --- a/app/file_test.go +++ b/app/file_test.go @@ -85,4 +85,18 @@ func TestDoUploadFile(t *testing.T) { if info3.Path != fmt.Sprintf("20080305/teams/%v/channels/%v/users/%v/%v/%v", teamId, channelId, userId, info3.Id, filename) { t.Fatal("stored file at incorrect path", info3.Path) } + + info4, err := th.App.DoUploadFile(time.Date(2009, 3, 5, 1, 2, 3, 4, time.Local), "../../"+teamId, "../../"+channelId, "../../"+userId, "../../"+filename, data) + if err != nil { + t.Fatal(err) + } else { + defer func() { + <-th.App.Srv.Store.FileInfo().PermanentDelete(info3.Id) + utils.RemoveFile(info3.Path) + }() + } + + if info4.Path != fmt.Sprintf("20090305/teams/%v/channels/%v/users/%v/%v/%v", teamId, channelId, userId, info4.Id, filename) { + t.Fatal("stored file at incorrect path", info4.Path) + } } -- cgit v1.2.3-1-g7c22