summaryrefslogtreecommitdiffstats
path: root/api4/file_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-04 11:42:38 -0400
committerGitHub <noreply@github.com>2017-10-04 11:42:38 -0400
commitfadd9514f6e71590aba781a7035e1de4150137b0 (patch)
treea265d44f377281abd56baf31fe878e08f90f7d4b /api4/file_test.go
parentfa80cb10a8ad047f9504c49ed2671d31650d1878 (diff)
downloadchat-fadd9514f6e71590aba781a7035e1de4150137b0.tar.gz
chat-fadd9514f6e71590aba781a7035e1de4150137b0.tar.bz2
chat-fadd9514f6e71590aba781a7035e1de4150137b0.zip
PLT-7718 Patch for files (#7564)
* Patch for files * Fix merge * Fix tests * Fix another test
Diffstat (limited to 'api4/file_test.go')
-rw-r--r--api4/file_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/api4/file_test.go b/api4/file_test.go
index 584625f70..615e601dc 100644
--- a/api4/file_test.go
+++ b/api4/file_test.go
@@ -102,6 +102,15 @@ func TestUploadFile(t *testing.T) {
_, resp := Client.UploadFile(data, model.NewId(), "test.png")
CheckForbiddenStatus(t, resp)
+ _, resp = Client.UploadFile(data, "../../junk", "test.png")
+ CheckForbiddenStatus(t, resp)
+
+ _, resp = th.SystemAdminClient.UploadFile(data, model.NewId(), "test.png")
+ CheckForbiddenStatus(t, resp)
+
+ _, resp = th.SystemAdminClient.UploadFile(data, "../../junk", "test.png")
+ CheckForbiddenStatus(t, resp)
+
_, resp = th.SystemAdminClient.UploadFile(data, channel.Id, "test.png")
CheckNoError(t, resp)