diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-09-06 20:43:18 -0700 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-09-06 20:43:18 -0700 |
commit | 77709ccdda86408d5135b8bc71462e2111992358 (patch) | |
tree | 5efc1631eb6cb31f8768fafeb58612557d98cb59 /api/general_test.go | |
parent | fd86a2490ea81eba8e12dcce76455710f182f81c (diff) | |
parent | e589accdaf38bb82cb5d3b5dd84eadf9bfb58b5c (diff) | |
download | chat-77709ccdda86408d5135b8bc71462e2111992358.tar.gz chat-77709ccdda86408d5135b8bc71462e2111992358.tar.bz2 chat-77709ccdda86408d5135b8bc71462e2111992358.zip |
Merge release-4.2
Diffstat (limited to 'api/general_test.go')
-rw-r--r-- | api/general_test.go | 20 |
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) { |