also suppress link previews from posts marked #nsfw
This commit is contained in:
parent
0da1233e8e
commit
dc08159538
3 changed files with 26 additions and 3 deletions
|
|
@ -67,7 +67,26 @@ defmodule Pleroma.Web.RichMedia.HelpersTest do
|
|||
{:ok, activity} =
|
||||
CommonAPI.post(user, %{
|
||||
"status" => "http://example.com/ogp",
|
||||
"spoiler_text" => "."
|
||||
"sensitive" => true
|
||||
})
|
||||
|
||||
%Object{} = object = Object.normalize(activity)
|
||||
|
||||
assert object.data["sensitive"]
|
||||
|
||||
Pleroma.Config.put([:rich_media, :enabled], true)
|
||||
|
||||
assert %{} = Pleroma.Web.RichMedia.Helpers.fetch_data_for_activity(activity)
|
||||
|
||||
Pleroma.Config.put([:rich_media, :enabled], false)
|
||||
end
|
||||
|
||||
test "refuses to crawl URLs from posts tagged NSFW" do
|
||||
user = insert(:user)
|
||||
|
||||
{:ok, activity} =
|
||||
CommonAPI.post(user, %{
|
||||
"status" => "http://example.com/ogp #nsfw"
|
||||
})
|
||||
|
||||
%Object{} = object = Object.normalize(activity)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue