Merge remote-tracking branch 'remotes/upstream/develop' into 1304-user-info-deprecation
# Conflicts: # lib/pleroma/user/info.ex # lib/pleroma/web/activity_pub/activity_pub.ex # lib/pleroma/web/activity_pub/transmogrifier.ex
This commit is contained in:
commit
a11a7176d5
14 changed files with 159 additions and 10 deletions
|
|
@ -12,12 +12,16 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
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
|
||||
|
||||
import Pleroma.Factory
|
||||
|
||||
clear_config([:instance, :federating])
|
||||
clear_config([:instance, :allow_relay])
|
||||
|
||||
describe "posting statuses" do
|
||||
setup do
|
||||
user = insert(:user)
|
||||
|
|
@ -29,6 +33,34 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
[conn: conn]
|
||||
end
|
||||
|
||||
test "posting a status does not increment reblog_count when relaying", %{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!"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue