Merge branch 'not-used-mock' into 'develop'
Not used mock See merge request pleroma/pleroma!3313
This commit is contained in:
commit
db716f860a
5 changed files with 0 additions and 102 deletions
|
|
@ -555,24 +555,11 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
assert length(json_response_and_validate_schema(conn, 200)) == 1
|
||||
end
|
||||
|
||||
@tag capture_log: true
|
||||
test "see move notifications" do
|
||||
old_user = insert(:user)
|
||||
new_user = insert(:user, also_known_as: [old_user.ap_id])
|
||||
%{user: follower, conn: conn} = oauth_access(["read:notifications"])
|
||||
|
||||
old_user_url = old_user.ap_id
|
||||
|
||||
body =
|
||||
File.read!("test/fixtures/users_mock/localhost.json")
|
||||
|> String.replace("{{nickname}}", old_user.nickname)
|
||||
|> Jason.encode!()
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: :get, url: ^old_user_url} ->
|
||||
%Tesla.Env{status: 200, body: body}
|
||||
end)
|
||||
|
||||
User.follow(follower, old_user)
|
||||
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
|
||||
Pleroma.Tests.ObanHelpers.perform_all()
|
||||
|
|
|
|||
|
|
@ -144,24 +144,11 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
|
|||
refute Repo.one(Notification)
|
||||
end
|
||||
|
||||
@tag capture_log: true
|
||||
test "Move notification" do
|
||||
old_user = insert(:user)
|
||||
new_user = insert(:user, also_known_as: [old_user.ap_id])
|
||||
follower = insert(:user)
|
||||
|
||||
old_user_url = old_user.ap_id
|
||||
|
||||
body =
|
||||
File.read!("test/fixtures/users_mock/localhost.json")
|
||||
|> String.replace("{{nickname}}", old_user.nickname)
|
||||
|> Jason.encode!()
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: :get, url: ^old_user_url} ->
|
||||
%Tesla.Env{status: 200, body: body}
|
||||
end)
|
||||
|
||||
User.follow(follower, old_user)
|
||||
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
|
||||
Pleroma.Tests.ObanHelpers.perform_all()
|
||||
|
|
|
|||
|
|
@ -383,19 +383,8 @@ defmodule Pleroma.Web.StreamerTest do
|
|||
user: user,
|
||||
token: oauth_token
|
||||
} do
|
||||
user_url = user.ap_id
|
||||
user2 = insert(:user)
|
||||
|
||||
body =
|
||||
File.read!("test/fixtures/users_mock/localhost.json")
|
||||
|> String.replace("{{nickname}}", user.nickname)
|
||||
|> Jason.encode!()
|
||||
|
||||
Tesla.Mock.mock_global(fn
|
||||
%{method: :get, url: ^user_url} ->
|
||||
%Tesla.Env{status: 200, body: body}
|
||||
end)
|
||||
|
||||
Streamer.get_topic_and_add_socket("user:notification", user, oauth_token)
|
||||
{:ok, _follower, _followed, follow_activity} = CommonAPI.follow(user2, user)
|
||||
|
||||
|
|
@ -409,20 +398,9 @@ defmodule Pleroma.Web.StreamerTest do
|
|||
token: oauth_token
|
||||
} do
|
||||
user_id = user.id
|
||||
user_url = user.ap_id
|
||||
other_user = insert(:user)
|
||||
other_user_id = other_user.id
|
||||
|
||||
body =
|
||||
File.read!("test/fixtures/users_mock/localhost.json")
|
||||
|> String.replace("{{nickname}}", user.nickname)
|
||||
|> Jason.encode!()
|
||||
|
||||
Tesla.Mock.mock_global(fn
|
||||
%{method: :get, url: ^user_url} ->
|
||||
%Tesla.Env{status: 200, body: body}
|
||||
end)
|
||||
|
||||
Streamer.get_topic_and_add_socket("user", user, oauth_token)
|
||||
{:ok, _follower, _followed, _follow_activity} = CommonAPI.follow(user, other_user)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue