From b31a934a804aed3f35442ceafe2080b0955e7317 Mon Sep 17 00:00:00 2001 From: dcc Date: Wed, 15 May 2024 00:57:23 -0700 Subject: total rebase --- test/pleroma/web/common_api/utils_test.exs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) mode change 100755 => 100644 test/pleroma/web/common_api/utils_test.exs (limited to 'test/pleroma/web/common_api/utils_test.exs') diff --git a/test/pleroma/web/common_api/utils_test.exs b/test/pleroma/web/common_api/utils_test.exs old mode 100755 new mode 100644 index c52d3e9..27b1da1 --- a/test/pleroma/web/common_api/utils_test.exs +++ b/test/pleroma/web/common_api/utils_test.exs @@ -200,7 +200,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do {result, _, []} = Utils.format_input(code, "text/markdown") assert result == - ~s[

@mario @luigi yo what’s up?

] + ~s[

@mario @luigi yo what's up?

] end test "remote mentions" do @@ -211,7 +211,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do {result, _, []} = Utils.format_input(code, "text/markdown") assert result == - ~s[

@mario @luigi yo what’s up?

] + ~s[

@mario @luigi yo what's up?

] end test "raw HTML" do @@ -229,7 +229,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do test "blockquote" do code = ~s[> whoms't are you quoting?] {result, [], []} = Utils.format_input(code, "text/markdown") - assert result == "

whoms’t are you quoting?

" + assert result == "

whoms't are you quoting?

" end test "code" do @@ -593,7 +593,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do test "returns list attachments with desc" do user = insert(:user) - object = insert(:note, %{user: user}) + object = insert(:attachment, %{user: user}) desc = Jason.encode!(%{object.id => "test-desc"}) assert Utils.attachments_from_ids_descs(["#{object.id}", "34"], desc, user) == [ @@ -605,7 +605,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do describe "attachments_from_ids/2" do test "returns attachments with descs" do user = insert(:user) - object = insert(:note, %{user: user}) + object = insert(:attachment, %{user: user}) desc = Jason.encode!(%{object.id => "test-desc"}) assert Utils.attachments_from_ids( @@ -621,7 +621,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do test "returns attachments without descs" do user = insert(:user) - object = insert(:note, %{user: user}) + object = insert(:attachment, %{user: user}) assert Utils.attachments_from_ids(%{media_ids: ["#{object.id}"]}, user) == [object.data] end @@ -637,6 +637,11 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert Utils.attachments_from_ids(%{media_ids: ["#{object.id}"]}, user2) == [] end + + test "checks that the object is of upload type" do + object = insert(:note) + assert Utils.attachments_from_ids(%{media_ids: ["#{object.id}"]}, nil) == [] + end end describe "maybe_add_list_data/3" do -- cgit v1.2.3