alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.ScheduledActivity
+ alias Pleroma.Tests.ObanHelpers
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.CommonAPI
[conn: conn]
end
+ test "posting a status and checks reblog count after perform all backroud job", %{conn: conn} do
+ Pleroma.Config.put([:instance, :federating], true)
+ Pleroma.Config.get([:instance, :allow_relay], true)
+ user = insert(:user)
+
+ response =
+ conn
+ |> assign(:user, user)
+ |> post("api/v1/statuses", %{
+ "content_type" => "text/plain",
+ "source" => "Pleroma FE",
+ "status" => "Hello world",
+ "visibility" => "public"
+ })
+ |> json_response(200)
+
+ assert response["reblogs_count"] == 0
+ ObanHelpers.perform_all()
+
+ response =
+ conn
+ |> assign(:user, user)
+ |> get("api/v1/statuses/#{response["id"]}", %{})
+ |> json_response(200)
+
+ assert response["reblogs_count"] == 0
+ end
+
test "posting a status", %{conn: conn} do
idempotency_key = "Pikachu rocks!"