X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Factivity_pub%2Ftransmogrifier%2Fnote_handling_test.exs;h=ea4a60835af78aaba1567b1b12a62d4a0c547c40;hb=694d98be550b0afe5b110c7f3c63e9cb382f2c90;hp=b61e5013a1044d12816cd45281a4c86cd7c0e348;hpb=cf0eb0c1c5c945c660295f51c99fe157b2b8229c;p=akkoma diff --git a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs index b61e5013a..ea4a60835 100644 --- a/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs +++ b/test/pleroma/web/activity_pub/transmogrifier/note_handling_test.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2021 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do @@ -39,7 +39,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) object = Object.normalize(data["object"], fetch: false) - assert "test" in object.data["tag"] + assert "test" in Object.tags(object) + assert Object.hashtags(object) == ["test"] end test "it cleans up incoming notices which are not really DMs" do @@ -154,7 +155,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do test "it does not work for deactivated users" do data = File.read!("test/fixtures/mastodon-post-activity.json") |> Jason.decode!() - insert(:user, ap_id: data["actor"], deactivated: true) + insert(:user, ap_id: data["actor"], is_active: false) assert {:error, _} = Transmogrifier.handle_incoming(data) end @@ -220,7 +221,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) object = Object.normalize(data["object"], fetch: false) - assert Enum.at(object.data["tag"], 2) == "moo" + assert Enum.at(Object.tags(object), 2) == "moo" + assert Object.hashtags(object) == ["moo"] end test "it works for incoming notices with contentMap" do