diff options
Diffstat (limited to 'test/web/ostatus/ostatus_controller_test.exs')
-rw-r--r-- | test/web/ostatus/ostatus_controller_test.exs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs index 7441e5fce..9e958f6ca 100644 --- a/test/web/ostatus/ostatus_controller_test.exs +++ b/test/web/ostatus/ostatus_controller_test.exs @@ -65,6 +65,7 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do test "gets a feed", %{conn: conn} do note_activity = insert(:note_activity) + object = Object.normalize(note_activity) user = User.get_cached_by_ap_id(note_activity.data["actor"]) conn = @@ -72,7 +73,7 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do |> put_req_header("content-type", "application/atom+xml") |> get("/users/#{user.nickname}/feed.atom") - assert response(conn, 200) =~ note_activity.data["object"]["content"] + assert response(conn, 200) =~ object.data["content"] end test "returns 404 for a missing feed", %{conn: conn} do @@ -86,8 +87,9 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do test "gets an object", %{conn: conn} do note_activity = insert(:note_activity) + object = Object.normalize(note_activity) user = User.get_cached_by_ap_id(note_activity.data["actor"]) - [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"])) + [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, object.data["id"])) url = "/objects/#{uuid}" conn = @@ -106,7 +108,8 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do test "404s on private objects", %{conn: conn} do note_activity = insert(:direct_note_activity) - [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"])) + object = Object.normalize(note_activity) + [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, object.data["id"])) conn |> get("/objects/#{uuid}") @@ -131,8 +134,8 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do test "404s on deleted objects", %{conn: conn} do note_activity = insert(:note_activity) - [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"])) - object = Object.get_by_ap_id(note_activity.data["object"]["id"]) + object = Object.normalize(note_activity) + [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, object.data["id"])) conn |> put_req_header("accept", "application/xml") |