summaryrefslogtreecommitdiffstats
path: root/api/channel_test.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-06-29 11:14:12 -0400
committerJoramWilander <jwawilander@gmail.com>2015-06-29 11:14:12 -0400
commitba998db0998e7782842e4f86a242edd1e52b5e97 (patch)
tree88b4e052c68d4434819aac798bd6822417ea1dc2 /api/channel_test.go
parent72d54e427c035162260f47b0b79864e6193861e9 (diff)
downloadchat-ba998db0998e7782842e4f86a242edd1e52b5e97.tar.gz
chat-ba998db0998e7782842e4f86a242edd1e52b5e97.tar.bz2
chat-ba998db0998e7782842e4f86a242edd1e52b5e97.zip
update unit tests for default channels
Diffstat (limited to 'api/channel_test.go')
-rw-r--r--api/channel_test.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/api/channel_test.go b/api/channel_test.go
index 2e2e3683a..dfae840dc 100644
--- a/api/channel_test.go
+++ b/api/channel_test.go
@@ -35,8 +35,15 @@ func TestCreateChannel(t *testing.T) {
}
rget := Client.Must(Client.GetChannels("")).Data.(*model.ChannelList)
- if rget.Channels[0].Name != channel.Name {
- t.Fatal("full name didn't match")
+ nameMatch := false
+ for _, c := range rget.Channels {
+ if c.Name == channel.Name {
+ nameMatch = true
+ }
+ }
+
+ if !nameMatch {
+ t.Fatal("Did not create channel with correct name")
}
if _, err := Client.CreateChannel(rchannel.Data.(*model.Channel)); err == nil {