[#1335] User: refactored :blocks field into :blocked_users relation.
Introduced UserBlock.
This commit is contained in:
parent
3a1aaadc18
commit
3db988250b
20 changed files with 234 additions and 69 deletions
|
|
@ -883,7 +883,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
||||
{:ok, user} = User.block(user, other_user)
|
||||
{:ok, _user_block} = User.block(user, other_user)
|
||||
|
||||
conn =
|
||||
conn
|
||||
|
|
|
|||
|
|
@ -1108,7 +1108,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
activity: activity
|
||||
} do
|
||||
other_user = insert(:user)
|
||||
{:ok, user} = User.block(user, other_user)
|
||||
{:ok, _user_block} = User.block(user, other_user)
|
||||
|
||||
{:ok, _, _} = CommonAPI.favorite(activity.id, other_user)
|
||||
|
||||
|
|
@ -1205,7 +1205,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
activity: activity
|
||||
} do
|
||||
other_user = insert(:user)
|
||||
{:ok, user} = User.block(user, other_user)
|
||||
{:ok, _user_block} = User.block(user, other_user)
|
||||
|
||||
{:ok, _, _} = CommonAPI.repeat(activity.id, other_user)
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
|
|||
blocker = insert(:user)
|
||||
blocked = insert(:user)
|
||||
user = insert(:user)
|
||||
{:ok, blocker} = User.block(blocker, blocked)
|
||||
{:ok, _user_block} = User.block(blocker, blocked)
|
||||
|
||||
{:ok, _blocked_direct} =
|
||||
CommonAPI.post(blocked, %{
|
||||
|
|
|
|||
|
|
@ -219,8 +219,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
|
||||
{:ok, user} = User.follow(user, other_user)
|
||||
{:ok, other_user} = User.subscribe(user, other_user)
|
||||
{:ok, user} = User.block(user, other_user)
|
||||
{:ok, other_user} = User.block(other_user, user)
|
||||
{:ok, _user_block} = User.block(user, other_user)
|
||||
{:ok, _user_block} = User.block(other_user, user)
|
||||
|
||||
expected = %{
|
||||
id: to_string(other_user.id),
|
||||
|
|
@ -291,7 +291,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
|
||||
other_user = insert(:user)
|
||||
{:ok, other_user} = User.follow(other_user, user)
|
||||
{:ok, other_user} = User.block(other_user, user)
|
||||
{:ok, _user_block} = User.block(other_user, user)
|
||||
{:ok, _} = User.follow(insert(:user), user)
|
||||
|
||||
expected = %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue