diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-06-19 13:46:51 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-06-19 10:46:51 -0700 |
commit | 1d66e64e54c59ea9184bd614790498451d025e25 (patch) | |
tree | 605353f462cde5eac7c36bec4a4b7d05e6fede2b /api4/system_test.go | |
parent | 59088a1687b999e40d7468ad27997d2ec78a294e (diff) | |
download | chat-1d66e64e54c59ea9184bd614790498451d025e25.tar.gz chat-1d66e64e54c59ea9184bd614790498451d025e25.tar.bz2 chat-1d66e64e54c59ea9184bd614790498451d025e25.zip |
Add POST and DELETE /license endpoints for v4 (#6665)
* Add POST and DELETE /license endpoints for v4
* Fix comment text
Diffstat (limited to 'api4/system_test.go')
-rw-r--r-- | api4/system_test.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/api4/system_test.go b/api4/system_test.go index a46e14782..57cc10343 100644 --- a/api4/system_test.go +++ b/api4/system_test.go @@ -356,3 +356,39 @@ func TestPostLog(t *testing.T) { t.Fatal("should return the log message") } } + +func TestUploadLicenseFile(t *testing.T) { + th := Setup().InitBasic().InitSystemAdmin() + defer TearDown() + Client := th.Client + + ok, resp := Client.UploadLicenseFile([]byte{}) + CheckForbiddenStatus(t, resp) + if ok { + t.Fatal("should fail") + } + + ok, resp = th.SystemAdminClient.UploadLicenseFile([]byte{}) + CheckBadRequestStatus(t, resp) + if ok { + t.Fatal("should fail") + } +} + +func TestRemoveLicenseFile(t *testing.T) { + th := Setup().InitBasic().InitSystemAdmin() + defer TearDown() + Client := th.Client + + ok, resp := Client.RemoveLicenseFile() + CheckForbiddenStatus(t, resp) + if ok { + t.Fatal("should fail") + } + + ok, resp = th.SystemAdminClient.RemoveLicenseFile() + CheckNoError(t, resp) + if !ok { + t.Fatal("should pass") + } +} |