diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-06-14 14:46:18 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-06-14 14:46:18 +0200 |
commit | 83c657afa557ac3cdfd2e3888511b403857de8aa (patch) | |
tree | 6013154129657c78b60a762b32d5baf3627876f2 /test/web/twitter_api/twitter_api_utils_test.exs | |
parent | 1af9c777365f3b54edcb572cea4e2e6f185b3099 (diff) | |
download | pleroma-83c657afa557ac3cdfd2e3888511b403857de8aa.tar.gz |
Do some basic escaping.
Diffstat (limited to 'test/web/twitter_api/twitter_api_utils_test.exs')
-rw-r--r-- | test/web/twitter_api/twitter_api_utils_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/twitter_api/twitter_api_utils_test.exs b/test/web/twitter_api/twitter_api_utils_test.exs new file mode 100644 index 000000000..62aa7843b --- /dev/null +++ b/test/web/twitter_api/twitter_api_utils_test.exs @@ -0,0 +1,14 @@ +defmodule Pleroma.Web.TwitterAPI.UtilsTest do + alias Pleroma.Web.TwitterAPI.Utils + use Pleroma.DataCase + + test "it adds attachment links to a given text and attachment set" do + attachment = %{ + "url" => [%{"href" => "http://heise.de/i\"m a boy.png"}] + } + + res = Utils.add_attachments("", [attachment]) + + assert res == "<br>\n<a href=\"http://heise.de/i%22m%20a%20boy.png\" class='attachment'>i\"m a boy.png</a>" + end +end |