Check refute User.following?

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2022-07-08 13:42:01 +02:00
parent ffe081bf44
commit 9022d855cd
3 changed files with 6 additions and 4 deletions

View File

@ -310,7 +310,7 @@ test "local users do not automatically follow local locked accounts" do
describe "unfollow/2" do describe "unfollow/2" do
setup do: clear_config([:instance, :external_user_synchronization]) setup do: clear_config([:instance, :external_user_synchronization])
test "unfollow with syncronizes external user" do test "unfollow with synchronizes external user" do
clear_config([:instance, :external_user_synchronization], true) clear_config([:instance, :external_user_synchronization], true)
followed = followed =
@ -2236,7 +2236,7 @@ test "updates the counters normally on following/getting a follow when disabled"
assert other_user.follower_count == 1 assert other_user.follower_count == 1
end end
test "syncronizes the counters with the remote instance for the followed when enabled" do test "synchronizes the counters with the remote instance for the followed when enabled" do
clear_config([:instance, :external_user_synchronization], false) clear_config([:instance, :external_user_synchronization], false)
user = insert(:user) user = insert(:user)
@ -2258,7 +2258,7 @@ test "syncronizes the counters with the remote instance for the followed when en
assert other_user.follower_count == 437 assert other_user.follower_count == 437
end end
test "syncronizes the counters with the remote instance for the follower when enabled" do test "synchronizes the counters with the remote instance for the follower when enabled" do
clear_config([:instance, :external_user_synchronization], false) clear_config([:instance, :external_user_synchronization], false)
user = insert(:user) user = insert(:user)

View File

@ -1665,7 +1665,7 @@ test "fetches only public posts for other users" do
end end
describe "fetch_follow_information_for_user" do describe "fetch_follow_information_for_user" do
test "syncronizes following/followers counters" do test "synchronizes following/followers counters" do
user = user =
insert(:user, insert(:user,
local: false, local: false,

View File

@ -1989,6 +1989,8 @@ test "removing user from followers", %{conn: conn, user: user} do
conn conn
|> post("/api/v1/accounts/#{other_user_id}/remove_from_followers") |> post("/api/v1/accounts/#{other_user_id}/remove_from_followers")
|> json_response_and_validate_schema(200) |> json_response_and_validate_schema(200)
refute User.following?(other_user, user)
end end
test "removing user from followers errors", %{user: user, conn: conn} do test "removing user from followers errors", %{user: user, conn: conn} do