diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-01-13 15:17:50 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-01-13 15:17:50 -0500 |
commit | 0e2b321e6f5ab5983bc3428aa455dac7012c36ee (patch) | |
tree | c3919a284cf13ddcb66a6f482b1c9bbd9f34fc9b /api/user_test.go | |
parent | 97558f6a6ec4c53fa69035fb430ead209d9c222d (diff) | |
download | chat-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 'api/user_test.go')
-rw-r--r-- | api/user_test.go | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/api/user_test.go b/api/user_test.go index fa7f28e6b..3163de078 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -107,25 +107,6 @@ func TestCheckUserDomain(t *testing.T) { } } -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() - } -} - func TestLogin(t *testing.T) { th := Setup() Client := th.CreateClient() @@ -227,7 +208,10 @@ func TestLogin(t *testing.T) { data := model.MapToJson(props) hash := model.HashPassword(fmt.Sprintf("%v:%v", data, utils.Cfg.EmailSettings.InviteSalt)) - ruser2, _ := Client.CreateUserFromSignup(&user2, data, hash) + ruser2, err := Client.CreateUserFromSignup(&user2, data, hash) + if err != nil { + t.Fatal(err) + } if _, err := Client.Login(ruser2.Data.(*model.User).Email, user2.Password); err != nil { t.Fatal("From verfied hash") @@ -686,7 +670,7 @@ func TestUserCreateImage(t *testing.T) { th := Setup() Client := th.CreateClient() - b, err := createProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba") + b, err := app.CreateProfileImage("Corey Hulen", "eo1zkdr96pdj98pjmq8zy35wba") if err != nil { t.Fatal(err) } |