X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fcommon_api%2Fcommon_api_utils_test.exs;h=d383d1714e172a9ef5125dd320a6d28330134137;hb=f0651730bdf018b713e21ce718719c7781398362;hp=848300ef37a2052ea0636105ca501f028b0bbd28;hpb=18a56410b821f1583d216dc55b9bd7b4d3a9c327;p=akkoma
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs
index 848300ef3..d383d1714 100644
--- a/test/web/common_api/common_api_utils_test.exs
+++ b/test/web/common_api/common_api_utils_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
hello world!
\n\nsecond paragraph
" - expected = "hello world!
\n\nsecond paragraph
" + text = "hello world!
second paragraph
" + expected = "hello world!
second paragraph
" {output, [], []} = Utils.format_input(text, "text/html") @@ -99,14 +99,14 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do test "works for bare text/markdown" do text = "**hello world**" - expected = "hello world
\n" + expected = "hello world
" {output, [], []} = Utils.format_input(text, "text/markdown") assert output == expected text = "**hello world**\n\n*another paragraph*" - expected = "hello world
\nanother paragraph
\n" + expected = "hello world
another paragraph
" {output, [], []} = Utils.format_input(text, "text/markdown") @@ -118,7 +118,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do by someone """ - expected = "\ncool quote
\n
by someone
\n" + expected = "cool quote
by someone
" {output, [], []} = Utils.format_input(text, "text/markdown") @@ -134,7 +134,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert output == expected text = "[b]hello world![/b]\n\nsecond paragraph!" - expected = "hello world!hello world
\nanother @user__test and @user__test google.com paragraph
\n) - {output, _, _} = Utils.format_input(text, "text/markdown") - assert output == expected + assert output == + ~s(hello world
another @user__test and @user__test google.com paragraph
) end end @@ -474,6 +472,13 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do activity = insert(:note_activity, user: user, note: object) Pleroma.Repo.delete(object) + obj_url = activity.data["object"] + + Tesla.Mock.mock(fn + %{method: :get, url: ^obj_url} -> + %Tesla.Env{status: 404, body: ""} + end) + assert Utils.maybe_notify_mentioned_recipients(["test-test"], activity) == [ "test-test" ]