From 83c657afa557ac3cdfd2e3888511b403857de8aa Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 14 Jun 2017 14:46:18 +0200 Subject: Do some basic escaping. --- test/web/twitter_api/twitter_api_utils_test.exs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/web/twitter_api/twitter_api_utils_test.exs (limited to 'test/web/twitter_api/twitter_api_utils_test.exs') 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 == "
\ni\"m a boy.png" + end +end -- cgit v1.2.3