summaryrefslogtreecommitdiffstats
path: root/app/user_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-04 13:09:41 -0700
committerGitHub <noreply@github.com>2017-10-04 13:09:41 -0700
commit07777f5ff9e0bde26abd0288164e5f73b6da992a (patch)
treeb0aa1eff510d1531d2924522e0e6f0e9bfd7ac29 /app/user_test.go
parentdc9b1a1d6a0fe7ad2e18597cb46f3874736b4b40 (diff)
downloadchat-07777f5ff9e0bde26abd0288164e5f73b6da992a.tar.gz
chat-07777f5ff9e0bde26abd0288164e5f73b6da992a.tar.bz2
chat-07777f5ff9e0bde26abd0288164e5f73b6da992a.zip
Fix races / finally remove global app for good (#7570)
* finally remove global app for good * test compilation fixes * fix races * fix deadlock * wake up write pump so it doesn't take forever to clean up
Diffstat (limited to 'app/user_test.go')
-rw-r--r--app/user_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/user_test.go b/app/user_test.go
index 63d2aafd5..39be7eafa 100644
--- a/app/user_test.go
+++ b/app/user_test.go
@@ -21,6 +21,8 @@ import (
func TestIsUsernameTaken(t *testing.T) {
th := Setup().InitBasic()
+ defer th.TearDown()
+
user := th.BasicUser
taken := th.App.IsUsernameTaken(user.Username)
@@ -40,6 +42,8 @@ func TestIsUsernameTaken(t *testing.T) {
func TestCheckUserDomain(t *testing.T) {
th := Setup().InitBasic()
+ defer th.TearDown()
+
user := th.BasicUser
cases := []struct {
@@ -66,6 +70,8 @@ func TestCheckUserDomain(t *testing.T) {
func TestCreateOAuthUser(t *testing.T) {
th := Setup().InitBasic()
+ defer th.TearDown()
+
r := rand.New(rand.NewSource(time.Now().UnixNano()))
glUser := oauthgitlab.GitLabUser{Id: int64(r.Intn(1000)) + 1, Username: "o" + model.NewId(), Email: model.NewId() + "@simulator.amazonses.com", Name: "Joram Wilander"}
@@ -116,6 +122,8 @@ func TestCreateProfileImage(t *testing.T) {
func TestUpdateOAuthUserAttrs(t *testing.T) {
th := Setup()
+ defer th.TearDown()
+
id := model.NewId()
id2 := model.NewId()
gitlabProvider := einterfaces.GetOauthProvider("gitlab")