summaryrefslogtreecommitdiffstats
path: root/model/license_test.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-14 09:08:13 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-14 09:08:13 -0600
commit6d6cada0970a2b341f36dac9b0fed8262ada1865 (patch)
treefc3728f15deaebd0c870838a63735659a33456e7 /model/license_test.go
parent0b986ed3147c885af6b2f33e1ff3eb6754e8f274 (diff)
parenta341dbad2b8a4564b6f270c79f2f9932e499ac80 (diff)
downloadchat-6d6cada0970a2b341f36dac9b0fed8262ada1865.tar.gz
chat-6d6cada0970a2b341f36dac9b0fed8262ada1865.tar.bz2
chat-6d6cada0970a2b341f36dac9b0fed8262ada1865.zip
Merge branch 'master' into PLT-1429
Diffstat (limited to 'model/license_test.go')
-rw-r--r--model/license_test.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/model/license_test.go b/model/license_test.go
new file mode 100644
index 000000000..25c74a2e3
--- /dev/null
+++ b/model/license_test.go
@@ -0,0 +1,34 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package model
+
+import (
+ "testing"
+)
+
+func TestLicenseExpired(t *testing.T) {
+ l1 := License{}
+ l1.ExpiresAt = GetMillis() - 1000
+ if !l1.IsExpired() {
+ t.Fatal("license should be expired")
+ }
+
+ l1.ExpiresAt = GetMillis() + 10000
+ if l1.IsExpired() {
+ t.Fatal("license should not be expired")
+ }
+}
+
+func TestLicenseStarted(t *testing.T) {
+ l1 := License{}
+ l1.StartsAt = GetMillis() - 1000
+ if !l1.IsStarted() {
+ t.Fatal("license should be started")
+ }
+
+ l1.StartsAt = GetMillis() + 10000
+ if l1.IsStarted() {
+ t.Fatal("license should not be started")
+ }
+}