Add a delete brand image action on the APIv4 (#9552)

Этот коммит содержится в:
Julien Levesy
2018-10-15 16:46:26 +02:00
коммит произвёл George Goldberg
родитель 160d278592
Коммит 43bdbb0c3a
4 изменённых файлов: 68 добавлений и 0 удалений

Просмотреть файл

@@ -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)
}