summaryrefslogtreecommitdiffstats
path: root/app/post_test.go
diff options
context:
space:
mode:
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)
+ }
})
}
}