Skip to content

Commit

Permalink
Updated style of unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
hmhealey committed Mar 28, 2017
1 parent fdce721 commit 727e158
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions api4/user_test.go
Expand Up @@ -866,26 +866,25 @@ func TestGetUsersWithoutTeam(t *testing.T) {
CheckNoError(t, resp)
defer app.Srv.Store.User().PermanentDelete(user2.Id)

if rusers, resp := SystemAdminClient.GetUsersWithoutTeam(0, 100, ""); resp.Error != nil {
t.Fatal(resp.Error)
} else {
found1 := false
found2 := false

for _, u := range rusers {
if u.Id == user.Id {
found1 = true
} else if u.Id == user2.Id {
found2 = true
}
}
rusers, resp := SystemAdminClient.GetUsersWithoutTeam(0, 100, "")
CheckNoError(t, resp)

if found1 {
t.Fatal("shouldn't have returned user that has a team")
} else if !found2 {
t.Fatal("should've returned user that has no teams")
found1 := false
found2 := false

for _, u := range rusers {
if u.Id == user.Id {
found1 = true
} else if u.Id == user2.Id {
found2 = true
}
}

if found1 {
t.Fatal("shouldn't have returned user that has a team")
} else if !found2 {
t.Fatal("should've returned user that has no teams")
}
}

func TestGetUsersInTeam(t *testing.T) {
Expand Down

0 comments on commit 727e158

Please sign in to comment.