summaryrefslogtreecommitdiffstats
path: root/api4/brand_test.go
diff options
context:
space:
mode:
authorJulien Levesy <jlevesy@gmail.com>2018-10-15 16:46:26 +0200
committerGeorge Goldberg <george@gberg.me>2018-10-15 15:46:26 +0100
commit43bdbb0c3a0d93a8bf34ae5e2abbad4586a2581b (patch)
treeaeca7af5d638e22c9e425f352494a1b17d72d83d /api4/brand_test.go
parent160d2785927d4729441dfa6ecd0d5536ec640687 (diff)
downloadchat-43bdbb0c3a0d93a8bf34ae5e2abbad4586a2581b.tar.gz
chat-43bdbb0c3a0d93a8bf34ae5e2abbad4586a2581b.tar.bz2
chat-43bdbb0c3a0d93a8bf34ae5e2abbad4586a2581b.zip
Add a delete brand image action on the APIv4 (#9552)
Diffstat (limited to 'api4/brand_test.go')
-rw-r--r--api4/brand_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/api4/brand_test.go b/api4/brand_test.go
index c1568c5cc..37169d99a 100644
--- a/api4/brand_test.go
+++ b/api4/brand_test.go
@@ -52,3 +52,30 @@ func TestUploadBrandImage(t *testing.T) {
_, resp = th.SystemAdminClient.UploadBrandImage(data)
CheckCreatedStatus(t, resp)
}
+
+func TestDeleteBrandImage(t *testing.T) {
+ th := Setup().InitBasic().InitSystemAdmin()
+ defer th.TearDown()
+
+ data, err := readTestFile("test.png")
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ _, resp := th.SystemAdminClient.UploadBrandImage(data)
+ CheckCreatedStatus(t, resp)
+
+ resp = th.Client.DeleteBrandImage()
+ CheckForbiddenStatus(t, resp)
+
+ th.Client.Logout()
+
+ resp = th.Client.DeleteBrandImage()
+ CheckUnauthorizedStatus(t, resp)
+
+ resp = th.SystemAdminClient.DeleteBrandImage()
+ CheckOKStatus(t, resp)
+
+ resp = th.SystemAdminClient.DeleteBrandImage()
+ CheckNotFoundStatus(t, resp)
+}