summaryrefslogtreecommitdiffstats
path: root/utils/config_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-06-16 17:05:23 -0400
committerChristopher Speller <crspeller@gmail.com>2015-06-16 17:05:23 -0400
commite9040749bdcb1d1bcb7fdd199e27fbe69c1f07ec (patch)
tree3c839bae149d18dc581710eaf03932358c9d77d4 /utils/config_test.go
parentfdb3f152748a3590516e53fd3864eb91d3b62bbb (diff)
downloadchat-e9040749bdcb1d1bcb7fdd199e27fbe69c1f07ec.tar.gz
chat-e9040749bdcb1d1bcb7fdd199e27fbe69c1f07ec.tar.bz2
chat-e9040749bdcb1d1bcb7fdd199e27fbe69c1f07ec.zip
Allow for setting of domain with enviroment variable
Diffstat (limited to 'utils/config_test.go')
-rw-r--r--utils/config_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/config_test.go b/utils/config_test.go
index 4d37b4e88..9067dc647 100644
--- a/utils/config_test.go
+++ b/utils/config_test.go
@@ -4,9 +4,24 @@
package utils
import (
+ "os"
"testing"
)
func TestConfig(t *testing.T) {
LoadConfig("config.json")
}
+
+func TestEnvOverride(t *testing.T) {
+ os.Setenv("MATTERMOST_DOMAIN", "testdomain.com")
+
+ LoadConfig("config_docker.json")
+ if Cfg.ServiceSettings.Domain != "testdomain.com" {
+ t.Fail()
+ }
+
+ LoadConfig("config.json")
+ if Cfg.ServiceSettings.Domain == "testdomain.com" {
+ t.Fail()
+ }
+}