summaryrefslogtreecommitdiffstats
path: root/app/post_test.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2018-08-01 11:43:58 -0400
committerGitHub <noreply@github.com>2018-08-01 11:43:58 -0400
commitecfba2c2e9e46389e2012e9adf1ab993aaa7ea5e (patch)
tree9caa617309e989ba4aafae9dbfaebabd99a4e537 /app/post_test.go
parentd81a61398d01d839e70e2345da787e7ef89c0832 (diff)
downloadchat-ecfba2c2e9e46389e2012e9adf1ab993aaa7ea5e.tar.gz
chat-ecfba2c2e9e46389e2012e9adf1ab993aaa7ea5e.tar.bz2
chat-ecfba2c2e9e46389e2012e9adf1ab993aaa7ea5e.zip
MM-11175 Add logic to server to understand markdown images with dimensions (#9159)
Diffstat (limited to 'app/post_test.go')
-rw-r--r--app/post_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/post_test.go b/app/post_test.go
index 186f960d5..482197833 100644
--- a/app/post_test.go
+++ b/app/post_test.go
@@ -295,6 +295,14 @@ func TestImageProxy(t *testing.T) {
assert.Equal(t, "![foo]("+tc.ImageURL+")", th.App.PostWithProxyRemovedFromImageURLs(post).Message)
post.Message = "![foo](" + tc.ProxiedImageURL + ")"
assert.Equal(t, "![foo]("+tc.ImageURL+")", th.App.PostWithProxyRemovedFromImageURLs(post).Message)
+
+ if tc.ImageURL != "" {
+ post.Message = "![foo](" + tc.ImageURL + " =500x200)"
+ assert.Equal(t, "![foo]("+tc.ProxiedImageURL+" =500x200)", th.App.PostWithProxyAddedToImageURLs(post).Message)
+ assert.Equal(t, "![foo]("+tc.ImageURL+" =500x200)", th.App.PostWithProxyRemovedFromImageURLs(post).Message)
+ post.Message = "![foo](" + tc.ProxiedImageURL + " =500x200)"
+ assert.Equal(t, "![foo]("+tc.ImageURL+" =500x200)", th.App.PostWithProxyRemovedFromImageURLs(post).Message)
+ }
})
}
}