config :pleroma, :websub, Pleroma.Web.WebsubMock
config :pleroma, :ostatus, Pleroma.Web.OStatusMock
config :tesla, adapter: Tesla.Mock
+config :pleroma, :rich_media, enabled: false
config :web_push_encryption, :vapid_details,
subject: "mailto:administrator@example.com",
setup tags do
Cachex.clear(:user_cache)
+ Cachex.clear(:object_cache)
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo)
unless tags[:async] do
setup tags do
Cachex.clear(:user_cache)
+ Cachex.clear(:object_cache)
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Pleroma.Repo)
unless tags[:async] do
end
test "posting a status with OGP link preview", %{conn: conn} do
+ Pleroma.Config.put([:rich_media, :enabled], true)
user = insert(:user)
conn =
assert %{"id" => id, "card" => %{"title" => "The Rock"}} = json_response(conn, 200)
assert Repo.get(Activity, id)
+ Pleroma.Config.put([:rich_media, :enabled], false)
end
test "posting a direct status", %{conn: conn} do
end
test "Status rich-media Card", %{conn: conn, user: user} do
+ Pleroma.Config.put([:rich_media, :enabled], true)
{:ok, activity} = CommonAPI.post(user, %{"status" => "http://example.com/ogp"})
response =
}
}
}
+
+ Pleroma.Config.put([:rich_media, :enabled], false)
end
end
note_object.data
|> Map.put("type", "Article")
+ Cachex.clear(:object_cache)
+
cs = Object.change(note_object, %{data: note_data})
{:ok, _article_object} = Repo.update(cs)