Announcements: Fix all tests.
This commit is contained in:
parent
d9d425708e
commit
23e248694d
21 changed files with 64 additions and 136 deletions
|
|
@ -256,7 +256,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
User.block(user_one, user_two)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(user_two, %{status: "User one sux0rz"})
|
||||
{:ok, repeat, _} = CommonAPI.repeat(activity.id, user_three)
|
||||
{:ok, repeat} = CommonAPI.repeat(activity.id, user_three)
|
||||
|
||||
assert resp =
|
||||
conn
|
||||
|
|
@ -375,7 +375,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
|
||||
test "gets a user's statuses without reblogs", %{user: user, conn: conn} do
|
||||
{:ok, %{id: post_id}} = CommonAPI.post(user, %{status: "HI!!!"})
|
||||
{:ok, _, _} = CommonAPI.repeat(post_id, user)
|
||||
{:ok, _} = CommonAPI.repeat(post_id, user)
|
||||
|
||||
conn = get(conn, "/api/v1/accounts/#{user.id}/statuses?exclude_reblogs=true")
|
||||
assert [%{"id" => ^post_id}] = json_response_and_validate_schema(conn, 200)
|
||||
|
|
@ -678,7 +678,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
assert %{"showing_reblogs" => false} = json_response_and_validate_schema(ret_conn, 200)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(other_user, %{status: "hey"})
|
||||
{:ok, %{id: reblog_id}, _} = CommonAPI.repeat(activity.id, followed)
|
||||
{:ok, %{id: reblog_id}} = CommonAPI.repeat(activity.id, followed)
|
||||
|
||||
assert [] ==
|
||||
conn
|
||||
|
|
|
|||
|
|
@ -280,8 +280,8 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
{:ok, unlisted_activity} =
|
||||
CommonAPI.post(other_user, %{status: ".", visibility: "unlisted"})
|
||||
|
||||
{:ok, _, _} = CommonAPI.repeat(public_activity.id, user)
|
||||
{:ok, _, _} = CommonAPI.repeat(unlisted_activity.id, user)
|
||||
{:ok, _} = CommonAPI.repeat(public_activity.id, user)
|
||||
{:ok, _} = CommonAPI.repeat(unlisted_activity.id, user)
|
||||
|
||||
activity_ids =
|
||||
conn
|
||||
|
|
@ -301,7 +301,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
{:ok, mention_activity} = CommonAPI.post(other_user, %{status: "hey @#{user.nickname}"})
|
||||
{:ok, create_activity} = CommonAPI.post(user, %{status: "hey"})
|
||||
{:ok, favorite_activity} = CommonAPI.favorite(other_user, create_activity.id)
|
||||
{:ok, reblog_activity, _} = CommonAPI.repeat(create_activity.id, other_user)
|
||||
{:ok, reblog_activity} = CommonAPI.repeat(create_activity.id, other_user)
|
||||
{:ok, _, _, follow_activity} = CommonAPI.follow(other_user, user)
|
||||
|
||||
mention_notification_id = get_notification_id_by_activity(mention_activity)
|
||||
|
|
@ -339,7 +339,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
{:ok, mention_activity} = CommonAPI.post(other_user, %{status: "hey @#{user.nickname}"})
|
||||
{:ok, create_activity} = CommonAPI.post(user, %{status: "hey"})
|
||||
{:ok, favorite_activity} = CommonAPI.favorite(other_user, create_activity.id)
|
||||
{:ok, reblog_activity, _} = CommonAPI.repeat(create_activity.id, other_user)
|
||||
{:ok, reblog_activity} = CommonAPI.repeat(create_activity.id, other_user)
|
||||
{:ok, _, _, follow_activity} = CommonAPI.follow(other_user, user)
|
||||
|
||||
mention_notification_id = get_notification_id_by_activity(mention_activity)
|
||||
|
|
|
|||
|
|
@ -878,8 +878,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
user3 = insert(:user)
|
||||
{:ok, _} = CommonAPI.favorite(user2, activity.id)
|
||||
{:ok, _bookmark} = Pleroma.Bookmark.create(user2.id, activity.id)
|
||||
{:ok, reblog_activity1, _object} = CommonAPI.repeat(activity.id, user1)
|
||||
{:ok, _, _object} = CommonAPI.repeat(activity.id, user2)
|
||||
{:ok, reblog_activity1} = CommonAPI.repeat(activity.id, user1)
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, user2)
|
||||
|
||||
conn_res =
|
||||
build_conn()
|
||||
|
|
@ -917,7 +917,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
test "unreblogs and returns the unreblogged status", %{user: user, conn: conn} do
|
||||
activity = insert(:note_activity)
|
||||
|
||||
{:ok, _, _} = CommonAPI.repeat(activity.id, user)
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, user)
|
||||
|
||||
conn =
|
||||
conn
|
||||
|
|
@ -1427,7 +1427,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
test "returns users who have reblogged the status", %{conn: conn, activity: activity} do
|
||||
other_user = insert(:user)
|
||||
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
|
||||
response =
|
||||
conn
|
||||
|
|
@ -1458,7 +1458,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
other_user = insert(:user)
|
||||
{:ok, _user_relationship} = User.block(user, other_user)
|
||||
|
||||
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
|
||||
response =
|
||||
conn
|
||||
|
|
@ -1469,12 +1469,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
end
|
||||
|
||||
test "does not return users who have reblogged the status privately", %{
|
||||
conn: conn,
|
||||
activity: activity
|
||||
conn: conn
|
||||
} do
|
||||
other_user = insert(:user)
|
||||
{:ok, activity} = CommonAPI.post(other_user, %{status: "my secret post"})
|
||||
|
||||
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user, %{visibility: "private"})
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, other_user, %{visibility: "private"})
|
||||
|
||||
response =
|
||||
conn
|
||||
|
|
@ -1486,7 +1486,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
test "does not fail on an unauthenticated request", %{activity: activity} do
|
||||
other_user = insert(:user)
|
||||
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
{:ok, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
|
||||
response =
|
||||
build_conn()
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
|
|||
user = insert(:user)
|
||||
another_user = insert(:user)
|
||||
{:ok, create_activity} = CommonAPI.post(user, %{status: "hey"})
|
||||
{:ok, reblog_activity, _object} = CommonAPI.repeat(create_activity.id, another_user)
|
||||
{:ok, reblog_activity} = CommonAPI.repeat(create_activity.id, another_user)
|
||||
{:ok, [notification]} = Notification.create_notifications(reblog_activity)
|
||||
reblog_activity = Activity.get_by_id(create_activity.id)
|
||||
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
user = insert(:user)
|
||||
activity = insert(:note_activity)
|
||||
|
||||
{:ok, reblog, _} = CommonAPI.repeat(activity.id, user)
|
||||
{:ok, reblog} = CommonAPI.repeat(activity.id, user)
|
||||
|
||||
represented = StatusView.render("show.json", %{for: user, activity: reblog})
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
status: "˙˙ɐʎns"
|
||||
})
|
||||
|
||||
{:ok, activity, _object} = CommonAPI.repeat(activity.id, other_user)
|
||||
{:ok, activity} = CommonAPI.repeat(activity.id, other_user)
|
||||
|
||||
result = StatusView.render("show.json", %{activity: activity, for: user})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue