summaryrefslogtreecommitdiffstats
path: root/app/webhook_test.go
diff options
context:
space:
mode:
authorMartin Kraft <martinkraft@gmail.com>2018-03-27 09:01:42 -0400
committerMartin Kraft <martinkraft@gmail.com>2018-03-27 09:01:42 -0400
commite13e64711f7a7e8ceadb8cbc6af72c4022c95b36 (patch)
treefe0e956b1d660cd08d41757d25c8adcb3463568c /app/webhook_test.go
parentd8b42070186c12f6320fe54ea1c405149846404c (diff)
parent9e6db178b09387e21ac19ce85369cf1ca7a443e8 (diff)
downloadchat-e13e64711f7a7e8ceadb8cbc6af72c4022c95b36.tar.gz
chat-e13e64711f7a7e8ceadb8cbc6af72c4022c95b36.tar.bz2
chat-e13e64711f7a7e8ceadb8cbc6af72c4022c95b36.zip
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-1
Diffstat (limited to 'app/webhook_test.go')
-rw-r--r--app/webhook_test.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/webhook_test.go b/app/webhook_test.go
index 4d2bc58fa..8931100ac 100644
--- a/app/webhook_test.go
+++ b/app/webhook_test.go
@@ -383,23 +383,25 @@ func TestSplitWebhookPost(t *testing.T) {
Expected []*model.Post
}
+ maxPostSize := 10000
+
for name, tc := range map[string]TestCase{
"LongPost": {
Post: &model.Post{
- Message: strings.Repeat("本", model.POST_MESSAGE_MAX_RUNES*3/2),
+ Message: strings.Repeat("本", maxPostSize*3/2),
},
Expected: []*model.Post{
{
- Message: strings.Repeat("本", model.POST_MESSAGE_MAX_RUNES),
+ Message: strings.Repeat("本", maxPostSize),
},
{
- Message: strings.Repeat("本", model.POST_MESSAGE_MAX_RUNES/2),
+ Message: strings.Repeat("本", maxPostSize/2),
},
},
},
"LongPostAndMultipleAttachments": {
Post: &model.Post{
- Message: strings.Repeat("本", model.POST_MESSAGE_MAX_RUNES*3/2),
+ Message: strings.Repeat("本", maxPostSize*3/2),
Props: map[string]interface{}{
"attachments": []*model.SlackAttachment{
&model.SlackAttachment{
@@ -416,10 +418,10 @@ func TestSplitWebhookPost(t *testing.T) {
},
Expected: []*model.Post{
{
- Message: strings.Repeat("本", model.POST_MESSAGE_MAX_RUNES),
+ Message: strings.Repeat("本", maxPostSize),
},
{
- Message: strings.Repeat("本", model.POST_MESSAGE_MAX_RUNES/2),
+ Message: strings.Repeat("本", maxPostSize/2),
Props: map[string]interface{}{
"attachments": []*model.SlackAttachment{
&model.SlackAttachment{
@@ -452,7 +454,7 @@ func TestSplitWebhookPost(t *testing.T) {
},
} {
t.Run(name, func(t *testing.T) {
- splits, err := SplitWebhookPost(tc.Post)
+ splits, err := SplitWebhookPost(tc.Post, maxPostSize)
if tc.Expected == nil {
require.NotNil(t, err)
} else {