diff options
author | Chris <ccbrown112@gmail.com> | 2017-07-31 08:52:45 -0700 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-07-31 11:52:45 -0400 |
commit | 72f61ab96aabf65c162c8d94b5b843b5108ee1a9 (patch) | |
tree | c80d7158613663a0b3f584a1736ef1cbff72d160 /store/sql_command_store_test.go | |
parent | 0f786a42d3289df9b4f5bdb4bddb0ecb07631608 (diff) | |
download | chat-72f61ab96aabf65c162c8d94b5b843b5108ee1a9.tar.gz chat-72f61ab96aabf65c162c8d94b5b843b5108ee1a9.tar.bz2 chat-72f61ab96aabf65c162c8d94b5b843b5108ee1a9.zip |
make cli team / channel delete operations also delete webhooks and slash commands (#7028)
Diffstat (limited to 'store/sql_command_store_test.go')
-rw-r--r-- | store/sql_command_store_test.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/store/sql_command_store_test.go b/store/sql_command_store_test.go index ff6e3b9eb..cd7db4c1d 100644 --- a/store/sql_command_store_test.go +++ b/store/sql_command_store_test.go @@ -111,6 +111,36 @@ func TestCommandStoreDelete(t *testing.T) { } } +func TestCommandStoreDeleteByTeam(t *testing.T) { + Setup() + + o1 := &model.Command{} + o1.CreatorId = model.NewId() + o1.Method = model.COMMAND_METHOD_POST + o1.TeamId = model.NewId() + o1.URL = "http://nowhere.com/" + o1.Trigger = "trigger" + + o1 = (<-store.Command().Save(o1)).Data.(*model.Command) + + if r1 := <-store.Command().Get(o1.Id); r1.Err != nil { + t.Fatal(r1.Err) + } else { + if r1.Data.(*model.Command).CreateAt != o1.CreateAt { + t.Fatal("invalid returned command") + } + } + + if r2 := <-store.Command().PermanentDeleteByTeam(o1.TeamId); r2.Err != nil { + t.Fatal(r2.Err) + } + + if r3 := (<-store.Command().Get(o1.Id)); r3.Err == nil { + t.Log(r3.Data) + t.Fatal("Missing id should have failed") + } +} + func TestCommandStoreDeleteByUser(t *testing.T) { Setup() |