mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 02:49:18 +00:00
replace Repo.get_by(User, ap_id: ap_id)
with User.get_by_ap_id(ap_id)
This commit is contained in:
parent
88d3cb44c3
commit
9a59c26619
|
@ -638,8 +638,8 @@ test "works with base64 encoded images" do
|
|||
describe "fetch the latest Follow" do
|
||||
test "fetches the latest Follow activity" do
|
||||
%Activity{data: %{"type" => "Follow"}} = activity = insert(:follow_activity)
|
||||
follower = Repo.get_by(User, ap_id: activity.data["actor"])
|
||||
followed = Repo.get_by(User, ap_id: activity.data["object"])
|
||||
follower = User.get_by_ap_id(activity.data["actor"])
|
||||
followed = User.get_by_ap_id(activity.data["object"])
|
||||
|
||||
assert activity == Utils.fetch_latest_follow(follower, followed)
|
||||
end
|
||||
|
|
|
@ -175,7 +175,7 @@ test "contains mentions" do
|
|||
|
||||
status = StatusView.render("status.json", %{activity: activity})
|
||||
|
||||
actor = Repo.get_by(User, ap_id: activity.actor)
|
||||
actor = User.get_by_ap_id(activity.actor)
|
||||
|
||||
assert status.mentions ==
|
||||
Enum.map([user, actor], fn u -> AccountView.render("mention.json", %{user: u}) end)
|
||||
|
|
|
@ -99,7 +99,7 @@ test "it pushes an activity to remote accounts it's addressed to" do
|
|||
}
|
||||
|
||||
{:ok, activity} = Repo.insert(%Activity{data: activity_data, recipients: activity_data["to"]})
|
||||
user = Repo.get_by(User, ap_id: activity.data["actor"])
|
||||
user = User.get_by_ap_id(activity.data["actor"])
|
||||
{:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user)
|
||||
|
||||
poster = fn url, _data, _headers ->
|
||||
|
|
|
@ -955,7 +955,7 @@ test "with credentials", %{conn: conn, user: current_user} do
|
|||
|> post(request_path)
|
||||
|
||||
activity = Activity.get_by_id(note_activity.id)
|
||||
activity_user = Repo.get_by(User, ap_id: note_activity.data["actor"])
|
||||
activity_user = User.get_by_ap_id(note_activity.data["actor"])
|
||||
|
||||
assert json_response(response, 200) ==
|
||||
ActivityView.render("activity.json", %{
|
||||
|
@ -993,7 +993,7 @@ test "with credentials", %{conn: conn, user: current_user} do
|
|||
|> post(request_path)
|
||||
|
||||
activity = Activity.get_by_id(note_activity.id)
|
||||
activity_user = Repo.get_by(User, ap_id: note_activity.data["actor"])
|
||||
activity_user = User.get_by_ap_id(note_activity.data["actor"])
|
||||
|
||||
assert json_response(response, 200) ==
|
||||
ActivityView.render("activity.json", %{
|
||||
|
|
Loading…
Reference in a new issue