Merge branch '2242-nsfw-case' into 'develop'

Resolve "Posts tagged with #NSFW from GS aren't marked as sensitive"

Closes #2242

See merge request pleroma/pleroma!3094
This commit is contained in:
rinpatch 2020-10-23 19:39:42 +00:00
commit 5f27a39152
3 changed files with 89 additions and 8 deletions

View file

@ -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!()