[#1335] Reorganized users.subscribers as UserRelationship. Added tests for UserRelati...
[akkoma] / test / web / mastodon_api / views / account_view_test.exs
index f8b74553b7c71e26ca089ad9e9579040cfa16e63..53cd26a697d7619c1797f93fd520376fbe5a083f 100644 (file)
@@ -190,12 +190,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
 
       {:ok, user} = User.follow(user, other_user)
       {:ok, other_user} = User.follow(other_user, user)
-      {:ok, other_user} = User.subscribe(user, other_user)
-      {:ok, _user_mute} = User.mute(user, other_user, true)
-      {:ok, user} = CommonAPI.hide_reblogs(user, other_user)
-
-      # Refreshing to reflect embedded ap id relation fields (remove once removed)
-      user = refresh_record(user)
+      {:ok, _subscription} = User.subscribe(user, other_user)
+      {:ok, _user_relationships} = User.mute(user, other_user, true)
+      {:ok, _reblog_mute} = CommonAPI.hide_reblogs(user, other_user)
 
       expected = %{
         id: to_string(other_user.id),
@@ -221,9 +218,9 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
       other_user = insert(:user)
 
       {:ok, user} = User.follow(user, other_user)
-      {:ok, other_user} = User.subscribe(user, other_user)
-      {:ok, _user_block} = User.block(user, other_user)
-      {:ok, _user_block} = User.block(other_user, user)
+      {:ok, _subscription} = User.subscribe(user, other_user)
+      {:ok, _user_relationship} = User.block(user, other_user)
+      {:ok, _user_relationship} = User.block(other_user, user)
 
       expected = %{
         id: to_string(other_user.id),
@@ -294,7 +291,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
 
     other_user = insert(:user)
     {:ok, other_user} = User.follow(other_user, user)
-    {:ok, _user_block} = User.block(other_user, user)
+    {:ok, _user_relationship} = User.block(other_user, user)
     {:ok, _} = User.follow(insert(:user), user)
 
     expected = %{