summaryrefslogtreecommitdiffstats
path: root/api/channel_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-02-02 09:04:36 -0500
committerGitHub <noreply@github.com>2017-02-02 09:04:36 -0500
commit609d4f43d9eef504d852fbf02af5473b0d1424c8 (patch)
tree63fe24f08d5364501d3afed7c44b6739719d86e3 /api/channel_test.go
parent2ac4f36587b8b217dcfd53e67c650c8ad27c75df (diff)
downloadchat-609d4f43d9eef504d852fbf02af5473b0d1424c8.tar.gz
chat-609d4f43d9eef504d852fbf02af5473b0d1424c8.tar.bz2
chat-609d4f43d9eef504d852fbf02af5473b0d1424c8.zip
Implement POST /channels endpoint for APIv4 (#5241)
Diffstat (limited to 'api/channel_test.go')
-rw-r--r--api/channel_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/api/channel_test.go b/api/channel_test.go
index 450c5556e..6e6883047 100644
--- a/api/channel_test.go
+++ b/api/channel_test.go
@@ -55,7 +55,7 @@ func TestCreateChannel(t *testing.T) {
rchannel.Data.(*model.Channel).Id = ""
if _, err := Client.CreateChannel(rchannel.Data.(*model.Channel)); err != nil {
- if err.Message != "A channel with that URL already exists" {
+ if err.Id != "store.sql_channel.save_channel.exists.app_error" {
t.Fatal(err)
}
}
@@ -1768,7 +1768,9 @@ func TestAutocompleteChannels(t *testing.T) {
channel2 = Client.Must(Client.CreateChannel(channel2)).Data.(*model.Channel)
channel3 := &model.Channel{DisplayName: "BadChannelC", Name: "c" + model.NewId() + "a", Type: model.CHANNEL_OPEN, TeamId: model.NewId()}
- channel3 = th.SystemAdminClient.Must(th.SystemAdminClient.CreateChannel(channel3)).Data.(*model.Channel)
+ if _, err := th.SystemAdminClient.CreateChannel(channel3); err == nil {
+ t.Fatal("channel must have valid team id")
+ }
channel4 := &model.Channel{DisplayName: "BadChannelD", Name: "d" + model.NewId() + "a", Type: model.CHANNEL_PRIVATE, TeamId: team.Id}
channel4 = Client.Must(Client.CreateChannel(channel4)).Data.(*model.Channel)