summaryrefslogtreecommitdiffstats
path: root/api/general_test.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2017-09-06 16:24:34 -0400
committerJoramWilander <jwawilander@gmail.com>2017-09-06 16:24:34 -0400
commitd38328976e2c8bb0fab91e656042a0d8ac37bc76 (patch)
tree7e3d1a96a007accfcea499857541f96890846122 /api/general_test.go
parentf968c56890bd84295672ee0d46cc846cac2dbd47 (diff)
downloadchat-d38328976e2c8bb0fab91e656042a0d8ac37bc76.tar.gz
chat-d38328976e2c8bb0fab91e656042a0d8ac37bc76.tar.bz2
chat-d38328976e2c8bb0fab91e656042a0d8ac37bc76.zip
Various patches
Diffstat (limited to 'api/general_test.go')
-rw-r--r--api/general_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/api/general_test.go b/api/general_test.go
index 51593ab9e..1fb041ae6 100644
--- a/api/general_test.go
+++ b/api/general_test.go
@@ -5,6 +5,8 @@ package api
import (
"testing"
+
+ "github.com/mattermost/platform/utils"
)
func TestGetClientProperties(t *testing.T) {
@@ -25,6 +27,24 @@ func TestLogClient(t *testing.T) {
if ret, _ := th.BasicClient.LogClient("this is a test"); !ret {
t.Fatal("failed to log")
}
+
+ enableDeveloper := *utils.Cfg.ServiceSettings.EnableDeveloper
+ defer func() {
+ *utils.Cfg.ServiceSettings.EnableDeveloper = enableDeveloper
+ }()
+ *utils.Cfg.ServiceSettings.EnableDeveloper = false
+
+ th.BasicClient.Logout()
+
+ if _, err := th.BasicClient.LogClient("this is a test"); err == nil {
+ t.Fatal("should have failed")
+ }
+
+ *utils.Cfg.ServiceSettings.EnableDeveloper = true
+
+ if ret, _ := th.BasicClient.LogClient("this is a test"); !ret {
+ t.Fatal("failed to log")
+ }
}
func TestGetPing(t *testing.T) {