1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ActivityPub.MRF.HashtagPolicyTest do
6 use Oban.Testing, repo: Pleroma.Repo
9 alias Pleroma.Web.ActivityPub.Transmogrifier
10 alias Pleroma.Web.CommonAPI
12 import Pleroma.Factory
14 test "it sets the sensitive property with relevant hashtags" do
17 {:ok, activity} = CommonAPI.post(user, %{status: "#nsfw hey"})
18 {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
20 assert modified["object"]["sensitive"]
23 test "it doesn't sets the sensitive property with irrelevant hashtags" do
26 {:ok, activity} = CommonAPI.post(user, %{status: "#cofe hey"})
27 {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data)
29 refute modified["object"]["sensitive"]