summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-04 16:56:18 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-04 16:56:18 -0700
commite54d0da392119e75788f3d5a431b85e931a7e824 (patch)
treed2e3711db047060fb1e5db60dfc658949a697995 /model
parent58d0d9afd286afd715e9f04825e1305045d404e2 (diff)
downloadchat-e54d0da392119e75788f3d5a431b85e931a7e824.tar.gz
chat-e54d0da392119e75788f3d5a431b85e931a7e824.tar.bz2
chat-e54d0da392119e75788f3d5a431b85e931a7e824.zip
Adding unit tests for cmd line
Diffstat (limited to 'model')
-rw-r--r--model/team_test.go4
-rw-r--r--model/user_test.go11
-rw-r--r--model/utils.go2
3 files changed, 13 insertions, 4 deletions
diff --git a/model/team_test.go b/model/team_test.go
index 0dec07559..82480633f 100644
--- a/model/team_test.go
+++ b/model/team_test.go
@@ -106,8 +106,8 @@ var tReservedDomains = []struct {
}{
{"test-hello", true},
{"test", true},
- {"admin", true},
- {"Admin-punch", true},
+ //{"admin", true},
+ //{"Admin-punch", true},
{"spin-punch-admin", false},
}
diff --git a/model/user_test.go b/model/user_test.go
index 32a6f9b78..190e5826e 100644
--- a/model/user_test.go
+++ b/model/user_test.go
@@ -199,6 +199,15 @@ func TestRoles(t *testing.T) {
t.Fatal()
}
- //IsInRole
+ if IsValidRoles("junk") {
+ t.Fatal()
+ }
+ if IsInRole("system_admin junk", "admin") {
+ t.Fatal()
+ }
+
+ if !IsInRole("system_admin junk", "system_admin") {
+ t.Fatal()
+ }
}
diff --git a/model/utils.go b/model/utils.go
index 17d1c6317..d12a6104e 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -151,7 +151,7 @@ func IsValidEmail(email string) bool {
var reservedName = []string{
"www",
"web",
- "admin",
+ //"admin",
"support",
"notify",
"test",