Merge branch 'develop' into feature/masto_api_markers
This commit is contained in:
commit
243719a965
119 changed files with 2392 additions and 4308 deletions
|
|
@ -424,8 +424,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
other_user = insert(:user)
|
||||
|
||||
{:ok, _activity} =
|
||||
CommonAPI.post(user, %{
|
||||
"status" => "Hey @#{other_user.nickname}.",
|
||||
CommonAPI.post(other_user, %{
|
||||
"status" => "Hey @#{user.nickname}.",
|
||||
"visibility" => "direct"
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
alias Pleroma.Web.CommonAPI.Utils
|
||||
alias Pleroma.Web.MastodonAPI.AccountView
|
||||
alias Pleroma.Web.MastodonAPI.StatusView
|
||||
alias Pleroma.Web.OStatus
|
||||
import Pleroma.Factory
|
||||
import Tesla.Mock
|
||||
|
||||
|
|
@ -230,17 +229,15 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
end
|
||||
|
||||
test "contains mentions" do
|
||||
incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml")
|
||||
# a user with this ap id might be in the cache.
|
||||
recipient = "https://pleroma.soykaf.com/users/lain"
|
||||
user = insert(:user, %{ap_id: recipient})
|
||||
user = insert(:user)
|
||||
mentioned = insert(:user)
|
||||
|
||||
{:ok, [activity]} = OStatus.handle_incoming(incoming)
|
||||
{:ok, activity} = CommonAPI.post(user, %{"status" => "hi @#{mentioned.nickname}"})
|
||||
|
||||
status = StatusView.render("show.json", %{activity: activity})
|
||||
|
||||
assert status.mentions ==
|
||||
Enum.map([user], fn u -> AccountView.render("mention.json", %{user: u}) end)
|
||||
Enum.map([mentioned], fn u -> AccountView.render("mention.json", %{user: u}) end)
|
||||
end
|
||||
|
||||
test "create mentions from the 'to' field" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue