diff options
author | Chris <ccbrown112@gmail.com> | 2017-11-16 08:40:26 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 08:40:26 -0600 |
commit | bf6bb9bce9723799991478e5aea745686045ad65 (patch) | |
tree | f9d84501c5db96563f53410aaa546aac8085157f /cmd/platform/config_test.go | |
parent | 6eb4b4604c79b0052cb7ab8ac97c9b90fa61e918 (diff) | |
download | chat-bf6bb9bce9723799991478e5aea745686045ad65.tar.gz chat-bf6bb9bce9723799991478e5aea745686045ad65.tar.bz2 chat-bf6bb9bce9723799991478e5aea745686045ad65.zip |
fix config cli option (#7850)
Diffstat (limited to 'cmd/platform/config_test.go')
-rw-r--r-- | cmd/platform/config_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/cmd/platform/config_test.go b/cmd/platform/config_test.go new file mode 100644 index 000000000..781e40de8 --- /dev/null +++ b/cmd/platform/config_test.go @@ -0,0 +1,29 @@ +// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package main + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/mattermost/mattermost-server/model" +) + +func TestConfigValidate(t *testing.T) { + dir, err := ioutil.TempDir("", "") + require.NoError(t, err) + defer os.RemoveAll(dir) + + path := filepath.Join(dir, "config.json") + config := &model.Config{} + config.SetDefaults() + require.NoError(t, ioutil.WriteFile(path, []byte(config.ToJson()), 0600)) + + assert.Contains(t, checkCommand(t, "--config", path, "config", "validate"), "The document is valid") +} |