Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma into develop
[akkoma] / test / pleroma / web / activity_pub / transmogrifier_test.exs
index 561674f010c1e6c748f0c9faca171beb267bec7a..e39af1dfc1d6b022f181a89b5ec6b7ce6c603a68 100644 (file)
@@ -101,7 +101,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
       {:ok, returned_activity} = Transmogrifier.handle_incoming(data)
       returned_object = Object.normalize(returned_activity, false)
 
-      assert activity =
+      assert %Activity{} =
                Activity.get_create_by_object_ap_id(
                  "https://mstdn.io/users/mayuutann/statuses/99568293732299394"
                )
@@ -206,6 +206,16 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
       assert user.note_count == 1
     end
 
+    test "it works for incoming notices without the sensitive property but an nsfw hashtag" do
+      data = File.read!("test/fixtures/mastodon-post-activity-nsfw.json") |> Poison.decode!()
+
+      {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data)
+
+      object_data = Object.normalize(data["object"], false).data
+
+      assert object_data["sensitive"] == true
+    end
+
     test "it works for incoming notices with hashtags" do
       data = File.read!("test/fixtures/mastodon-post-activity-hashtag.json") |> Poison.decode!()