Merge branch 'gun' into 'develop'
Gun adapter Closes #945 See merge request pleroma/pleroma!1861
This commit is contained in:
commit
ef7d2b0f11
77 changed files with 3343 additions and 511 deletions
|
|
@ -452,11 +452,24 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
|
|||
assert length(json_response(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()
|
||||
|
|
|
|||
|
|
@ -112,11 +112,24 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
|
|||
test_notifications_rendering([notification], followed, [])
|
||||
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()
|
||||
|
|
|
|||
|
|
@ -94,6 +94,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do
|
|||
Repo.delete(user)
|
||||
Cachex.clear(:user_cache)
|
||||
|
||||
finger_url =
|
||||
"https://localhost/.well-known/webfinger?resource=acct:#{user.nickname}@localhost"
|
||||
|
||||
Tesla.Mock.mock_global(fn
|
||||
%{method: :get, url: "http://localhost/.well-known/host-meta"} ->
|
||||
%Tesla.Env{status: 404, body: ""}
|
||||
|
||||
%{method: :get, url: "https://localhost/.well-known/host-meta"} ->
|
||||
%Tesla.Env{status: 404, body: ""}
|
||||
|
||||
%{
|
||||
method: :get,
|
||||
url: ^finger_url
|
||||
} ->
|
||||
%Tesla.Env{status: 404, body: ""}
|
||||
end)
|
||||
|
||||
%{account: ms_user} = StatusView.render("show.json", activity: activity)
|
||||
|
||||
assert ms_user.acct == "erroruser@example.com"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue