summaryrefslogtreecommitdiffstats
path: root/api4/system_test.go
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2017-03-14 17:06:07 +0100
committerGeorge Goldberg <george@gberg.me>2017-03-14 16:06:07 +0000
commitfa47132b8f1d6d889450021f6afbdc903208ac41 (patch)
tree128ff3b7563e3fcef45c0ddc07704335566eb881 /api4/system_test.go
parenta1994cf7ce3d660edd4be4a470b1239443a99275 (diff)
downloadchat-fa47132b8f1d6d889450021f6afbdc903208ac41.tar.gz
chat-fa47132b8f1d6d889450021f6afbdc903208ac41.tar.bz2
chat-fa47132b8f1d6d889450021f6afbdc903208ac41.zip
[APIV4] POST /caches/invalidate - endpoint for apiV4 (#5756)
Diffstat (limited to 'api4/system_test.go')
-rw-r--r--api4/system_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/api4/system_test.go b/api4/system_test.go
index cb6ca7b81..4da91f428 100644
--- a/api4/system_test.go
+++ b/api4/system_test.go
@@ -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")
+ }
}