aboutsummaryrefslogtreecommitdiffhomepage
path: root/model/theme_test.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-11-25 19:06:02 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-11-25 19:06:02 -0800
commit51f77754660ddcd29f61be293a8e405d8cd3ba18 (patch)
treec421b1ab2a470e23e3ce6dbf2d09878087ebd614 /model/theme_test.go
parent4560af165e7fa25dddd46f49ad4a0d9f3149336c (diff)
Add unit tests for models
Diffstat (limited to 'model/theme_test.go')
-rw-r--r--model/theme_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/model/theme_test.go b/model/theme_test.go
new file mode 100644
index 0000000..b2a8cdb
--- /dev/null
+++ b/model/theme_test.go
@@ -0,0 +1,19 @@
+// Copyright 2017 Frédéric Guillot. All rights reserved.
+// Use of this source code is governed by the Apache 2.0
+// license that can be found in the LICENSE file.
+
+package model
+
+import "testing"
+
+func TestValidateTheme(t *testing.T) {
+ for _, status := range []string{"default", "black"} {
+ if err := ValidateTheme(status); err != nil {
+ t.Error(`A valid theme should not generate any error`)
+ }
+ }
+
+ if err := ValidateTheme("invalid"); err == nil {
+ t.Error(`An invalid theme should generate a error`)
+ }
+}