2017-06-14 05:46:18 -07:00
|
|
|
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])
|
|
|
|
|
2017-08-09 07:55:18 -07:00
|
|
|
assert res == "<br>\n<a href=\"http://heise.de/i\"m a boy.png\" class='attachment'>i\"m a boy.png</a>"
|
2017-06-14 05:46:18 -07:00
|
|
|
end
|
|
|
|
end
|