Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into emoji-reaction-extensions
This commit is contained in:
commit
7d8b709d29
15 changed files with 45 additions and 29 deletions
|
|
@ -745,7 +745,7 @@ defmodule Pleroma.NotificationTest do
|
|||
|
||||
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
|
||||
|
||||
assert length(Notification.for_user(user, %{with_muted: true})) == 0
|
||||
assert Enum.empty?(Notification.for_user(user, %{with_muted: true}))
|
||||
end
|
||||
|
||||
test "it doesn't return notifications from a domain-blocked user when with_muted is set" do
|
||||
|
|
@ -755,7 +755,7 @@ defmodule Pleroma.NotificationTest do
|
|||
|
||||
{:ok, _activity} = CommonAPI.post(blocked, %{"status" => "hey @#{user.nickname}"})
|
||||
|
||||
assert length(Notification.for_user(user, %{with_muted: true})) == 0
|
||||
assert Enum.empty?(Notification.for_user(user, %{with_muted: true}))
|
||||
end
|
||||
|
||||
test "it returns notifications from muted threads when with_muted is set" do
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.FollowHandlingTest do
|
|||
)
|
||||
|> Repo.all()
|
||||
|
||||
assert length(accepts) == 0
|
||||
assert Enum.empty?(accepts)
|
||||
end
|
||||
|
||||
test "it works for follow requests when you are already followed, creating a new accept activity" do
|
||||
|
|
|
|||
|
|
@ -1363,9 +1363,9 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
}
|
||||
end
|
||||
|
||||
test "requires write:reports scope", %{conn: conn, id: id, admin: admin} do
|
||||
read_token = insert(:oauth_token, user: admin, scopes: ["read"])
|
||||
write_token = insert(:oauth_token, user: admin, scopes: ["write:reports"])
|
||||
test "requires admin:write:reports scope", %{conn: conn, id: id, admin: admin} do
|
||||
read_token = insert(:oauth_token, user: admin, scopes: ["admin:read"])
|
||||
write_token = insert(:oauth_token, user: admin, scopes: ["admin:write:reports"])
|
||||
|
||||
response =
|
||||
conn
|
||||
|
|
@ -1376,7 +1376,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|> json_response(403)
|
||||
|
||||
assert response == %{
|
||||
"error" => "Insufficient permissions: admin:write:reports | write:reports."
|
||||
"error" => "Insufficient permissions: admin:write:reports."
|
||||
}
|
||||
|
||||
conn
|
||||
|
|
@ -2864,7 +2864,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|
||||
response = json_response(ret_conn, 200)
|
||||
|
||||
assert length(response) == 0
|
||||
assert Enum.empty?(response)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -284,22 +284,22 @@ defmodule Pleroma.Web.CommonAPITest do
|
|||
{:ok, %Activity{}, _} = CommonAPI.favorite(activity.id, user)
|
||||
end
|
||||
|
||||
test "retweeting a status twice returns an error" do
|
||||
test "retweeting a status twice returns the status" do
|
||||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
|
||||
{:ok, %Activity{}, _object} = CommonAPI.repeat(activity.id, user)
|
||||
{:error, _} = CommonAPI.repeat(activity.id, user)
|
||||
{:ok, %Activity{} = activity, object} = CommonAPI.repeat(activity.id, user)
|
||||
{:ok, ^activity, ^object} = CommonAPI.repeat(activity.id, user)
|
||||
end
|
||||
|
||||
test "favoriting a status twice returns an error" do
|
||||
test "favoriting a status twice returns the status" do
|
||||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
||||
{:ok, activity} = CommonAPI.post(other_user, %{"status" => "cofe"})
|
||||
{:ok, %Activity{}, _object} = CommonAPI.favorite(activity.id, user)
|
||||
{:error, _} = CommonAPI.favorite(activity.id, user)
|
||||
{:ok, %Activity{} = activity, object} = CommonAPI.favorite(activity.id, user)
|
||||
{:ok, ^activity, ^object} = CommonAPI.favorite(activity.id, user)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
|
|||
|
||||
{to, cc} = Utils.get_to_and_cc(user, mentions, nil, "private", nil)
|
||||
assert length(to) == 2
|
||||
assert length(cc) == 0
|
||||
assert Enum.empty?(cc)
|
||||
|
||||
assert mentioned_user.ap_id in to
|
||||
assert user.follower_address in to
|
||||
|
|
@ -323,7 +323,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
|
|||
{to, cc} = Utils.get_to_and_cc(user, mentions, activity, "private", nil)
|
||||
|
||||
assert length(to) == 3
|
||||
assert length(cc) == 0
|
||||
assert Enum.empty?(cc)
|
||||
|
||||
assert mentioned_user.ap_id in to
|
||||
assert third_user.ap_id in to
|
||||
|
|
@ -338,7 +338,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
|
|||
{to, cc} = Utils.get_to_and_cc(user, mentions, nil, "direct", nil)
|
||||
|
||||
assert length(to) == 1
|
||||
assert length(cc) == 0
|
||||
assert Enum.empty?(cc)
|
||||
|
||||
assert mentioned_user.ap_id in to
|
||||
end
|
||||
|
|
@ -353,7 +353,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
|
|||
{to, cc} = Utils.get_to_and_cc(user, mentions, activity, "direct", nil)
|
||||
|
||||
assert length(to) == 2
|
||||
assert length(cc) == 0
|
||||
assert Enum.empty?(cc)
|
||||
|
||||
assert mentioned_user.ap_id in to
|
||||
assert third_user.ap_id in to
|
||||
|
|
|
|||
|
|
@ -638,6 +638,13 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
assert to_string(activity.id) == id
|
||||
end
|
||||
|
||||
test "favoriting twice will just return 200", %{conn: conn} do
|
||||
activity = insert(:note_activity)
|
||||
|
||||
post(conn, "/api/v1/statuses/#{activity.id}/favourite")
|
||||
assert post(conn, "/api/v1/statuses/#{activity.id}/favourite") |> json_response(200)
|
||||
end
|
||||
|
||||
test "returns 400 error for a wrong id", %{conn: conn} do
|
||||
conn = post(conn, "/api/v1/statuses/1/favourite")
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ defmodule Pleroma.Web.TwitterAPI.PasswordControllerTest do
|
|||
|
||||
user = refresh_record(user)
|
||||
assert Comeonin.Pbkdf2.checkpw("test", user.password_hash)
|
||||
assert length(Token.get_user_tokens(user)) == 0
|
||||
assert Enum.empty?(Token.get_user_tokens(user))
|
||||
end
|
||||
|
||||
test "it sets password_reset_pending to false", %{conn: conn} do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue