summaryrefslogtreecommitdiffstats
path: root/model/outgoing_webhook_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/outgoing_webhook_test.go')
-rw-r--r--model/outgoing_webhook_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/model/outgoing_webhook_test.go b/model/outgoing_webhook_test.go
index 24b81d221..2458c62e4 100644
--- a/model/outgoing_webhook_test.go
+++ b/model/outgoing_webhook_test.go
@@ -163,3 +163,14 @@ func TestOutgoingWebhookPreUpdate(t *testing.T) {
o := OutgoingWebhook{}
o.PreUpdate()
}
+
+func TestOutgoingWebhookTriggerWordStartsWith(t *testing.T) {
+ o := OutgoingWebhook{Id: NewId()}
+ o.TriggerWords = append(o.TriggerWords, "foo")
+ if !o.TriggerWordStartsWith("foobar") {
+ t.Fatal("Should return true")
+ }
+ if o.TriggerWordStartsWith("barfoo") {
+ t.Fatal("Should return false")
+ }
+}