diff options
author | Pierre Rudloff <contact@rudloff.pro> | 2016-07-26 14:04:28 +0200 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-07-26 08:04:28 -0400 |
commit | 564dffec35d2ab6772c2561f28d9ad9a2bcbeb40 (patch) | |
tree | 6e6caeee6f96707bc5faad7f984e673026e7806e /model/outgoing_webhook_test.go | |
parent | c56b429e1dee257bac69de1db55cafee01ccd005 (diff) | |
download | chat-564dffec35d2ab6772c2561f28d9ad9a2bcbeb40.tar.gz chat-564dffec35d2ab6772c2561f28d9ad9a2bcbeb40.tar.bz2 chat-564dffec35d2ab6772c2561f28d9ad9a2bcbeb40.zip |
Add option to trigger outgoing webhook if first word starts with trigger word (#3611)
Diffstat (limited to 'model/outgoing_webhook_test.go')
-rw-r--r-- | model/outgoing_webhook_test.go | 11 |
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") + } +} |