From 97de1d0982ddb4818f5e41527f4d7da2234e829f Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 4 Apr 2017 15:17:47 -0400 Subject: Fix blanking out of FileIds and backwards compatability issue with v3 (#5950) --- api4/post_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'api4/post_test.go') diff --git a/api4/post_test.go b/api4/post_test.go index 562136ca9..e5c72ae9e 100644 --- a/api4/post_test.go +++ b/api4/post_test.go @@ -167,6 +167,15 @@ func TestUpdatePost(t *testing.T) { Client.Logout() _, resp = Client.UpdatePost(rpost.Id, rpost) CheckUnauthorizedStatus(t, resp) + + th.LoginBasic2() + _, resp = Client.UpdatePost(rpost.Id, rpost) + CheckForbiddenStatus(t, resp) + + Client.Logout() + + _, resp = th.SystemAdminClient.UpdatePost(rpost.Id, rpost) + CheckNoError(t, resp) } func TestPatchPost(t *testing.T) { @@ -262,6 +271,10 @@ func TestPatchPost(t *testing.T) { _, resp = Client.PatchPost(post.Id, patch) CheckUnauthorizedStatus(t, resp) + th.LoginBasic2() + _, resp = Client.PatchPost(post.Id, patch) + CheckForbiddenStatus(t, resp) + th.LoginTeamAdmin() _, resp = Client.PatchPost(post.Id, patch) CheckNoError(t, resp) -- cgit v1.2.3-1-g7c22