[APIV4] POST /caches/invalidate - endpoint for apiV4 (#5756)

Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-03-14 17:06:07 +01:00
коммит произвёл George Goldberg
родитель a1994cf7ce
Коммит fa47132b8f
3 изменённых файлов: 48 добавлений и 1 удалений

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

@@ -126,5 +126,22 @@ func TestDatabaseRecycle(t *testing.T) {
_, resp = th.SystemAdminClient.DatabaseRecycle()
CheckNoError(t, resp)
}
func TestInvalidateCaches(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()
Client := th.Client
flag, resp := Client.InvalidateCaches()
CheckForbiddenStatus(t, resp)
if flag == true {
t.Fatal("should not clean the cache due no permission.")
}
flag, resp = th.SystemAdminClient.InvalidateCaches()
CheckNoError(t, resp)
if flag == false {
t.Fatal("should clean the cache")
}
}