summaryrefslogtreecommitdiffstats
path: root/app/user_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-01-13 15:17:50 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2017-01-13 15:17:50 -0500
commit0e2b321e6f5ab5983bc3428aa455dac7012c36ee (patch)
treec3919a284cf13ddcb66a6f482b1c9bbd9f34fc9b /app/user_test.go
parent97558f6a6ec4c53fa69035fb430ead209d9c222d (diff)
downloadchat-0e2b321e6f5ab5983bc3428aa455dac7012c36ee.tar.gz
chat-0e2b321e6f5ab5983bc3428aa455dac7012c36ee.tar.bz2
chat-0e2b321e6f5ab5983bc3428aa455dac7012c36ee.zip
Refactor and migrate more functions out of api into app package (#5063)
Diffstat (limited to 'app/user_test.go')
-rw-r--r--app/user_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/user_test.go b/app/user_test.go
new file mode 100644
index 000000000..ce2249ca0
--- /dev/null
+++ b/app/user_test.go
@@ -0,0 +1,27 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package app
+
+import (
+ "testing"
+)
+
+func TestIsUsernameTaken(t *testing.T) {
+ th := Setup().InitBasic()
+ user := th.BasicUser
+ taken := IsUsernameTaken(user.Username)
+
+ if !taken {
+ t.Logf("the username '%v' should be taken", user.Username)
+ t.FailNow()
+ }
+
+ newUsername := "randomUsername"
+ taken = IsUsernameTaken(newUsername)
+
+ if taken {
+ t.Logf("the username '%v' should not be taken", newUsername)
+ t.FailNow()
+ }
+}