summaryrefslogtreecommitdiffstats
path: root/api/team_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-08-11 18:20:10 +0100
committerGeorge Goldberg <george@gberg.me>2017-08-11 18:20:10 +0100
commit638c38cc0d2296335a0fbd5bde8b6d2cbf9f9062 (patch)
tree4049492574a1870a400d5dac4f142652a47edbfa /api/team_test.go
parente7053b971b69f5b93c8ff18f4cfdde70a82a0e8e (diff)
downloadchat-638c38cc0d2296335a0fbd5bde8b6d2cbf9f9062.tar.gz
chat-638c38cc0d2296335a0fbd5bde8b6d2cbf9f9062.tar.bz2
chat-638c38cc0d2296335a0fbd5bde8b6d2cbf9f9062.zip
PLT-7336: Fix team API endpoints.
Diffstat (limited to 'api/team_test.go')
-rw-r--r--api/team_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/api/team_test.go b/api/team_test.go
index 14c9311a3..3c05588ce 100644
--- a/api/team_test.go
+++ b/api/team_test.go
@@ -239,6 +239,11 @@ func TestGetAllTeams(t *testing.T) {
} else if receivedTeam, ok := teams[team.Id]; !ok || receivedTeam.Id != team.Id {
t.Fatal("admin should've received team that they aren't a member of")
}
+
+ Client.Logout()
+ if _, err := Client.GetAllTeams(); err == nil {
+ t.Fatal("Should have failed due to not being logged in.")
+ }
}
func TestGetAllTeamListings(t *testing.T) {
@@ -855,4 +860,18 @@ func TestGetTeamByName(t *testing.T) {
t.Fatal("Should not exist this team")
}
+ Client.Logout()
+ if _, err := Client.GetTeamByName(th.BasicTeam.Name); err == nil {
+ t.Fatal("Should have failed when not logged in.")
+ }
+}
+
+func TestFindTeamByName(t *testing.T) {
+ th := Setup().InitBasic()
+ Client := th.BasicClient
+ Client.Logout()
+
+ if _, err := Client.FindTeamByName(th.BasicTeam.Name); err == nil {
+ t.Fatal("Should have failed when not logged in.")
+ }
}