summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/views
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-10-18 17:56:15 -0500
committerMark Felder <feld@FreeBSD.org>2019-10-18 17:56:15 -0500
commitdcb23a85b6b05db4958b82ad14083cfa8577f477 (patch)
treecc8197a3780fcab86a10b1055501ba570b8e0c3b /test/web/mastodon_api/views
parent152caef51d69ba4a47ac59346c782dfff8488f8b (diff)
parent5c6c3026ea7bd20cb2c10f6e2e34a54734d2509e (diff)
downloadpleroma-dcb23a85b6b05db4958b82ad14083cfa8577f477.tar.gz
pleroma-dcb23a85b6b05db4958b82ad14083cfa8577f477.zip
Merge branch 'develop' into feature/push-subject-for-dm
Diffstat (limited to 'test/web/mastodon_api/views')
-rw-r--r--test/web/mastodon_api/views/account_view_test.exs4
-rw-r--r--test/web/mastodon_api/views/status_view_test.exs11
2 files changed, 6 insertions, 9 deletions
diff --git a/test/web/mastodon_api/views/account_view_test.exs b/test/web/mastodon_api/views/account_view_test.exs
index b7a4938a6..ad209b4a3 100644
--- a/test/web/mastodon_api/views/account_view_test.exs
+++ b/test/web/mastodon_api/views/account_view_test.exs
@@ -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"
})
diff --git a/test/web/mastodon_api/views/status_view_test.exs b/test/web/mastodon_api/views/status_view_test.exs
index 1d5a6e956..c200ad8fe 100644
--- a/test/web/mastodon_api/views/status_view_test.exs
+++ b/test/web/mastodon_api/views/status_view_test.exs
@@ -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