summaryrefslogtreecommitdiffstats
path: root/store/sql_webhook_store_test.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-01-11 10:04:01 -0600
committer=Corey Hulen <corey@hulen.com>2016-01-11 10:04:01 -0600
commit2fd597043b45a75495164915ba6c41d5ab18c5ae (patch)
tree41df6781fa1a42777f6cea867b95dc30f08aa5d0 /store/sql_webhook_store_test.go
parent2bf43e79582c2e8ca50caa29d7457716112b4796 (diff)
downloadchat-2fd597043b45a75495164915ba6c41d5ab18c5ae.tar.gz
chat-2fd597043b45a75495164915ba6c41d5ab18c5ae.tar.bz2
chat-2fd597043b45a75495164915ba6c41d5ab18c5ae.zip
Chaning webhooks to be team wide
Diffstat (limited to 'store/sql_webhook_store_test.go')
-rw-r--r--store/sql_webhook_store_test.go34
1 files changed, 3 insertions, 31 deletions
diff --git a/store/sql_webhook_store_test.go b/store/sql_webhook_store_test.go
index 1a9d5be3b..5b43d0730 100644
--- a/store/sql_webhook_store_test.go
+++ b/store/sql_webhook_store_test.go
@@ -48,7 +48,7 @@ func TestWebhookStoreGetIncoming(t *testing.T) {
}
}
-func TestWebhookStoreGetIncomingByUser(t *testing.T) {
+func TestWebhookStoreGetIncomingByTeam(t *testing.T) {
Setup()
o1 := &model.IncomingWebhook{}
@@ -58,7 +58,7 @@ func TestWebhookStoreGetIncomingByUser(t *testing.T) {
o1 = (<-store.Webhook().SaveIncoming(o1)).Data.(*model.IncomingWebhook)
- if r1 := <-store.Webhook().GetIncomingByUser(o1.UserId); r1.Err != nil {
+ if r1 := <-store.Webhook().GetIncomingByTeam(o1.TeamId); r1.Err != nil {
t.Fatal(r1.Err)
} else {
if r1.Data.([]*model.IncomingWebhook)[0].CreateAt != o1.CreateAt {
@@ -66,7 +66,7 @@ func TestWebhookStoreGetIncomingByUser(t *testing.T) {
}
}
- if result := <-store.Webhook().GetIncomingByUser("123"); result.Err != nil {
+ if result := <-store.Webhook().GetIncomingByTeam("123"); result.Err != nil {
t.Fatal(result.Err)
} else {
if len(result.Data.([]*model.IncomingWebhook)) != 0 {
@@ -201,34 +201,6 @@ func TestWebhookStoreGetOutgoingByChannel(t *testing.T) {
}
}
-func TestWebhookStoreGetOutgoingByCreator(t *testing.T) {
- Setup()
-
- o1 := &model.OutgoingWebhook{}
- o1.ChannelId = model.NewId()
- o1.CreatorId = model.NewId()
- o1.TeamId = model.NewId()
- o1.CallbackURLs = []string{"http://nowhere.com/"}
-
- o1 = (<-store.Webhook().SaveOutgoing(o1)).Data.(*model.OutgoingWebhook)
-
- if r1 := <-store.Webhook().GetOutgoingByCreator(o1.CreatorId); r1.Err != nil {
- t.Fatal(r1.Err)
- } else {
- if r1.Data.([]*model.OutgoingWebhook)[0].CreateAt != o1.CreateAt {
- t.Fatal("invalid returned webhook")
- }
- }
-
- if result := <-store.Webhook().GetOutgoingByCreator("123"); result.Err != nil {
- t.Fatal(result.Err)
- } else {
- if len(result.Data.([]*model.OutgoingWebhook)) != 0 {
- t.Fatal("no webhooks should have returned")
- }
- }
-}
-
func TestWebhookStoreGetOutgoingByTeam(t *testing.T) {
Setup()