summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store_test.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-23 08:19:51 -0400
committerJoramWilander <jwawilander@gmail.com>2015-07-23 08:19:51 -0400
commitd42d0e3467c8eec38fdca429ba9ba5ac2af68db8 (patch)
tree0f1d6d24162d049e4fa847cf95aeb51d79003213 /store/sql_user_store_test.go
parentfabdc9a32661fd0410560ca918f5302249f9cfad (diff)
downloadchat-d42d0e3467c8eec38fdca429ba9ba5ac2af68db8.tar.gz
chat-d42d0e3467c8eec38fdca429ba9ba5ac2af68db8.tar.bz2
chat-d42d0e3467c8eec38fdca429ba9ba5ac2af68db8.zip
added store unit test for user.GetByAuth and added password length checking in api.login
Diffstat (limited to 'store/sql_user_store_test.go')
-rw-r--r--store/sql_user_store_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go
index 12737caa8..1f94021b2 100644
--- a/store/sql_user_store_test.go
+++ b/store/sql_user_store_test.go
@@ -236,6 +236,25 @@ func TestUserStoreGetByEmail(t *testing.T) {
}
}
+func TestUserStoreGetByAuthData(t *testing.T) {
+ Setup()
+
+ u1 := model.User{}
+ u1.TeamId = model.NewId()
+ u1.Email = model.NewId()
+ u1.AuthData = "123"
+ u1.AuthService = "service"
+ Must(store.User().Save(&u1))
+
+ if err := (<-store.User().GetByAuth(u1.TeamId, u1.AuthData, u1.AuthService)).Err; err != nil {
+ t.Fatal(err)
+ }
+
+ if err := (<-store.User().GetByAuth("", "", "")).Err; err == nil {
+ t.Fatal("Should have failed because of missing auth data")
+ }
+}
+
func TestUserStoreGetByUsername(t *testing.T) {
Setup()