diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-07-06 17:57:36 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-07-06 17:57:36 -0700 |
commit | f839b6349645ad2dc021425a806f20243d15ed0d (patch) | |
tree | 2e9caa49cbd59837aa960c53388781f9f365691f /api/channel_test.go | |
parent | 2a0516f1fd66e3e815f4356caac8eb641519474a (diff) | |
download | chat-f839b6349645ad2dc021425a806f20243d15ed0d.tar.gz chat-f839b6349645ad2dc021425a806f20243d15ed0d.tar.bz2 chat-f839b6349645ad2dc021425a806f20243d15ed0d.zip |
Added new error message when trying to add a channel that was previously deleted as well as a corresponding unit test
Diffstat (limited to 'api/channel_test.go')
-rw-r--r-- | api/channel_test.go | 9 |
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 { |