summaryrefslogtreecommitdiffstats
path: root/model/config_test.go
diff options
context:
space:
mode:
authorDerrick Anderson <derrick@andersonwebstudio.com>2018-02-12 16:13:01 -0500
committerDerrick Anderson <derrick@andersonwebstudio.com>2018-02-12 16:13:01 -0500
commit32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c (patch)
tree5e1653318a6a14bcad80025793adab0f700deed9 /model/config_test.go
parent62efb1df754bfe6b10a3c17ca6f89fd33b991f56 (diff)
parentc209e4457457edc042f063390c9a222a694f3a6d (diff)
downloadchat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.tar.gz
chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.tar.bz2
chat-32c1f7be239ddb19d6c59b114d9ae1a543f8ba9c.zip
Merge branch 'release-4.7-revertmaster' into release-4.7
Diffstat (limited to 'model/config_test.go')
-rw-r--r--model/config_test.go52
1 files changed, 1 insertions, 51 deletions
diff --git a/model/config_test.go b/model/config_test.go
index 919f73fd7..5510c40d0 100644
--- a/model/config_test.go
+++ b/model/config_test.go
@@ -136,7 +136,7 @@ func TestMessageExportSettingsIsValidBatchSizeInvalid(t *testing.T) {
require.Error(t, mes.isValid(*fs))
}
-func TestMessageExportSettingsIsValidExportFormatInvalid(t *testing.T) {
+func TestMessageExportSettingsIsValid(t *testing.T) {
fs := &FileSettings{
DriverName: NewString("foo"), // bypass file location check
}
@@ -147,55 +147,6 @@ func TestMessageExportSettingsIsValidExportFormatInvalid(t *testing.T) {
BatchSize: NewInt(100),
}
- // should fail fast because export format isn't set
- require.Error(t, mes.isValid(*fs))
-}
-
-func TestMessageExportSettingsIsValidGlobalRelayEmailAddressInvalid(t *testing.T) {
- fs := &FileSettings{
- DriverName: NewString("foo"), // bypass file location check
- }
- mes := &MessageExportSettings{
- EnableExport: NewBool(true),
- ExportFormat: NewString(COMPLIANCE_EXPORT_TYPE_GLOBALRELAY),
- ExportFromTimestamp: NewInt64(0),
- DailyRunTime: NewString("15:04"),
- BatchSize: NewInt(100),
- }
-
- // should fail fast because global relay email address isn't set
- require.Error(t, mes.isValid(*fs))
-}
-
-func TestMessageExportSettingsIsValidActiance(t *testing.T) {
- fs := &FileSettings{
- DriverName: NewString("foo"), // bypass file location check
- }
- mes := &MessageExportSettings{
- EnableExport: NewBool(true),
- ExportFormat: NewString(COMPLIANCE_EXPORT_TYPE_ACTIANCE),
- ExportFromTimestamp: NewInt64(0),
- DailyRunTime: NewString("15:04"),
- BatchSize: NewInt(100),
- }
-
- // should pass because everything is valid
- require.Nil(t, mes.isValid(*fs))
-}
-
-func TestMessageExportSettingsIsValidGlobalRelay(t *testing.T) {
- fs := &FileSettings{
- DriverName: NewString("foo"), // bypass file location check
- }
- mes := &MessageExportSettings{
- EnableExport: NewBool(true),
- ExportFormat: NewString(COMPLIANCE_EXPORT_TYPE_GLOBALRELAY),
- ExportFromTimestamp: NewInt64(0),
- DailyRunTime: NewString("15:04"),
- BatchSize: NewInt(100),
- GlobalRelayEmailAddress: NewString("test@mattermost.com"),
- }
-
// should pass because everything is valid
require.Nil(t, mes.isValid(*fs))
}
@@ -208,7 +159,6 @@ func TestMessageExportSetDefaults(t *testing.T) {
require.Equal(t, "01:00", *mes.DailyRunTime)
require.Equal(t, int64(0), *mes.ExportFromTimestamp)
require.Equal(t, 10000, *mes.BatchSize)
- require.Equal(t, COMPLIANCE_EXPORT_TYPE_ACTIANCE, *mes.ExportFormat)
}
func TestMessageExportSetDefaultsExportEnabledExportFromTimestampNil(t *testing.T) {