diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-09-14 08:58:53 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-09-14 08:58:53 -0400 |
commit | c3742aef71801544172cf77a46d52835594096a4 (patch) | |
tree | 76b3aacf1ee6da724201ea5411bef068cce3b26a /model/user_test.go | |
parent | 75721b5cb5ea19c1d6754adcc82891fa888fcacf (diff) | |
parent | 714f47e015adf4a455d29cbddfb5f58f84d9973e (diff) | |
download | chat-c3742aef71801544172cf77a46d52835594096a4.tar.gz chat-c3742aef71801544172cf77a46d52835594096a4.tar.bz2 chat-c3742aef71801544172cf77a46d52835594096a4.zip |
Merge pull request #648 from mattermost/PLT-12
PLT-12: Work in progress for Admin Console UI
Diffstat (limited to 'model/user_test.go')
-rw-r--r-- | model/user_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/model/user_test.go b/model/user_test.go index a3b4be091..d9c1a00b6 100644 --- a/model/user_test.go +++ b/model/user_test.go @@ -192,3 +192,26 @@ func TestCleanUsername(t *testing.T) { t.Fatal("didn't clean name properly") } } + +func TestRoles(t *testing.T) { + + if !IsValidRoles("admin") { + t.Fatal() + } + + if IsValidRoles("junk") { + t.Fatal() + } + + if IsInRole("system_admin junk", "admin") { + t.Fatal() + } + + if !IsInRole("system_admin junk", "system_admin") { + t.Fatal() + } + + if IsInRole("admin", "system_admin") { + t.Fatal() + } +} |