X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Factivity_pub%2Factivity_pub_controller_test.exs;h=e722f7c04ee157c990365d5e741b7b6449b6c734;hb=c3383d4fab6181d9f605a6058805333611534398;hp=3f48553c98a1fbbbe69598a09bb329047c7092f4;hpb=b3b367b894d1605202625310e7d8b1ed6ed5eb13;p=akkoma diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 3f48553c9..e722f7c04 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -536,6 +536,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do assert_receive {:mix_shell, :info, ["relay.mastodon.host"]} end + @tag capture_log: true test "without valid signature, " <> "it only accepts Create activities and requires enabled federation", %{conn: conn} do @@ -648,11 +649,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do test "it accepts announces with to as string instead of array", %{conn: conn} do user = insert(:user) + {:ok, post} = CommonAPI.post(user, %{status: "hey"}) + announcer = insert(:user, local: false) + data = %{ "@context" => "https://www.w3.org/ns/activitystreams", - "actor" => "http://mastodon.example.org/users/admin", - "id" => "http://mastodon.example.org/users/admin/statuses/19512778738411822/activity", - "object" => "https://mastodon.social/users/emelie/statuses/101849165031453009", + "actor" => announcer.ap_id, + "id" => "#{announcer.ap_id}/statuses/19512778738411822/activity", + "object" => post.data["object"], "to" => "https://www.w3.org/ns/activitystreams#Public", "cc" => [user.ap_id], "type" => "Announce" @@ -810,7 +814,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do outbox_endpoint = user.ap_id <> "/outbox" _posts = - for i <- 0..15 do + for i <- 0..25 do {:ok, activity} = CommonAPI.post(user, %{status: "post #{i}"}) activity end @@ -822,8 +826,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do |> json_response(200) result_ids = Enum.map(result["orderedItems"], fn x -> x["id"] end) - assert length(result["orderedItems"]) == 10 - assert length(result_ids) == 10 + assert length(result["orderedItems"]) == 20 + assert length(result_ids) == 20 assert result["next"] assert String.starts_with?(result["next"], outbox_endpoint)