summaryrefslogtreecommitdiff
path: root/test/user/synchronization_worker_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-07-15 14:11:54 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-07-15 14:11:54 +0700
commit64a946643e6f9159a8029be8ec9e0b71b04906f3 (patch)
treebf44cb695880f368aa2976fe134e83baea60927a /test/user/synchronization_worker_test.exs
parenta87c313309b73ced5970c59d00117c357f51fecb (diff)
parent46ef8f021635c630bcd6973e6fbb7c58bcafb6bf (diff)
downloadpleroma-64a946643e6f9159a8029be8ec9e0b71b04906f3.tar.gz
pleroma-64a946643e6f9159a8029be8ec9e0b71b04906f3.zip
Merge remote-tracking branch 'pleroma/develop' into feature/addressable-lists
Diffstat (limited to 'test/user/synchronization_worker_test.exs')
-rw-r--r--test/user/synchronization_worker_test.exs49
1 files changed, 0 insertions, 49 deletions
diff --git a/test/user/synchronization_worker_test.exs b/test/user/synchronization_worker_test.exs
deleted file mode 100644
index 835c5327f..000000000
--- a/test/user/synchronization_worker_test.exs
+++ /dev/null
@@ -1,49 +0,0 @@
-# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
-# SPDX-License-Identifier: AGPL-3.0-only
-
-defmodule Pleroma.User.SynchronizationWorkerTest do
- use Pleroma.DataCase
- import Pleroma.Factory
-
- setup do
- Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
-
- config = Pleroma.Config.get([:instance, :external_user_synchronization])
-
- for_update = [enabled: true, interval: 1000]
-
- Pleroma.Config.put([:instance, :external_user_synchronization], for_update)
-
- on_exit(fn ->
- Pleroma.Config.put([:instance, :external_user_synchronization], config)
- end)
-
- :ok
- end
-
- test "sync follow counters" do
- user1 =
- insert(:user,
- local: false,
- ap_id: "http://localhost:4001/users/masto_closed"
- )
-
- user2 = insert(:user, local: false, ap_id: "http://localhost:4001/users/fuser2")
-
- {:ok, _} = Pleroma.User.SynchronizationWorker.start_link()
- :timer.sleep(1500)
-
- %{follower_count: followers, following_count: following} =
- Pleroma.User.get_cached_user_info(user1)
-
- assert followers == 437
- assert following == 152
-
- %{follower_count: followers, following_count: following} =
- Pleroma.User.get_cached_user_info(user2)
-
- assert followers == 527
- assert following == 267
- end
-end