X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Fo_status%2Fo_status_controller_test.exs;h=81d66983763b1f879775d0ab1aaeafaaddc5f68f;hb=51a9f97e87823cbd9e92c375f4bc4c0bfa8b79db;hp=5cdca019a0ccc033bedf79d5e210bbe903b10de4;hpb=2926713fe5c36b8fc64bcce13ca16bc12eaff96c;p=akkoma diff --git a/test/pleroma/web/o_status/o_status_controller_test.exs b/test/pleroma/web/o_status/o_status_controller_test.exs index 5cdca019a..81d669837 100644 --- a/test/pleroma/web/o_status/o_status_controller_test.exs +++ b/test/pleroma/web/o_status/o_status_controller_test.exs @@ -144,13 +144,19 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do assert redirect_url == expected_redirect_url end - test "returns a 404 on remote notice when json requested", %{conn: conn} do + test "redirects to a proper object URL when json requested and the object is remote", %{ + conn: conn + } do note_activity = insert(:note_activity, local: false) + expected_redirect_url = Object.normalize(note_activity, fetch: false).data["id"] - conn - |> put_req_header("accept", "application/activity+json") - |> get("/notice/#{note_activity.id}") - |> response(404) + redirect_url = + conn + |> put_req_header("accept", "application/activity+json") + |> get("/notice/#{note_activity.id}") + |> redirected_to() + + assert redirect_url == expected_redirect_url end test "500s when actor not found", %{conn: conn} do @@ -176,7 +182,7 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do |> response(200) assert resp =~ - "" + "" user = insert(:user)