summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-07 23:12:08 -0800
committerCorey Hulen <corey@hulen.com>2015-07-07 23:12:08 -0800
commitf6e8b4f310fdfee13326854acb2443f5b65d1022 (patch)
tree9415b03eb156654269171e2c124a2ab6620b85ba /api
parent817d9110b39c0b39e798f8efa83c47a22eaac0c3 (diff)
parentf839b6349645ad2dc021425a806f20243d15ed0d (diff)
downloadchat-f6e8b4f310fdfee13326854acb2443f5b65d1022.tar.gz
chat-f6e8b4f310fdfee13326854acb2443f5b65d1022.tar.bz2
chat-f6e8b4f310fdfee13326854acb2443f5b65d1022.zip
Merge pull request #143 from rgarmsen2295/mm-1416
MM-1416 Changed error message when adding a previously deleted channel to be better suited
Diffstat (limited to 'api')
-rw-r--r--api/channel_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/api/channel_test.go b/api/channel_test.go
index ff09ab4bc..ed0554693 100644
--- a/api/channel_test.go
+++ b/api/channel_test.go
@@ -52,6 +52,8 @@ func TestCreateChannel(t *testing.T) {
t.Fatal("Cannot create an existing")
}
+ savedId := rchannel.Data.(*model.Channel).Id
+
rchannel.Data.(*model.Channel).Id = ""
if _, err := Client.CreateChannel(rchannel.Data.(*model.Channel)); err != nil {
if err.Message != "A channel with that name already exists" {
@@ -63,6 +65,13 @@ func TestCreateChannel(t *testing.T) {
t.Fatal("should have been an error")
}
+ Client.DeleteChannel(savedId)
+ if _, err := Client.CreateChannel(rchannel.Data.(*model.Channel)); err != nil {
+ if err.Message != "A channel with that name was previously created" {
+ t.Fatal(err)
+ }
+ }
+
channel = model.Channel{DisplayName: "Channel on Different Team", Name: "aaaa" + model.NewId() + "abbb", Type: model.CHANNEL_OPEN, TeamId: team2.Id}
if _, err := Client.CreateChannel(&channel); err.StatusCode != http.StatusForbidden {