Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework

# Conflicts:
#	CHANGELOG.md
This commit is contained in:
Ivan Tashkinov 2021-01-21 20:20:35 +03:00
commit 2634a16b4c
161 changed files with 1462 additions and 473 deletions

View file

@ -1027,8 +1027,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
user = Repo.preload(token_from_db, :user).user
assert user
refute user.confirmation_pending
refute user.approval_pending
assert user.is_confirmed
assert user.is_approved
end
test "registers but does not log in with :account_activation_required", %{conn: conn} do
@ -1088,7 +1088,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
refute response["token_type"]
user = Repo.get_by(User, email: "lain@example.org")
assert user.confirmation_pending
refute user.is_confirmed
end
test "registers but does not log in with :account_approval_required", %{conn: conn} do
@ -1150,7 +1150,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
user = Repo.get_by(User, email: "lain@example.org")
assert user.approval_pending
refute user.is_approved
assert user.registration_reason == "I'm a cool dude, bro"
end

View file

@ -954,6 +954,23 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert to_string(activity.id) == id
end
test "author can reblog own private status", %{conn: conn, user: user} do
{:ok, activity} = CommonAPI.post(user, %{status: "cofe", visibility: "private"})
conn =
conn
|> put_req_header("content-type", "application/json")
|> post("/api/v1/statuses/#{activity.id}/reblog")
assert %{
"reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 1},
"reblogged" => true,
"visibility" => "private"
} = json_response_and_validate_schema(conn, 200)
assert to_string(activity.id) == id
end
end
describe "unreblogging" do

View file

@ -79,7 +79,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
also_known_as: ["https://shitposter.zone/users/shp"],
background_image: "https://example.com/images/asuka_hospital.png",
favicon: nil,
confirmation_pending: false,
is_confirmed: true,
tags: [],
is_admin: false,
is_moderator: false,
@ -178,7 +178,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
also_known_as: [],
background_image: nil,
favicon: nil,
confirmation_pending: false,
is_confirmed: true,
tags: [],
is_admin: false,
is_moderator: false,