Merge branch 'develop' into issue/1383
This commit is contained in:
commit
6813c0302c
79 changed files with 1053 additions and 374 deletions
|
|
@ -269,7 +269,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
|
|||
|> json_response(200)
|
||||
|
||||
assert account_data["fields"] == [
|
||||
%{"name" => "foo", "value" => "bar"},
|
||||
%{"name" => "<a href=\"http://google.com\">foo</a>", "value" => "bar"},
|
||||
%{"name" => "link", "value" => ~S(<a href="http://cofe.io" rel="ugc">cofe.io</a>)}
|
||||
]
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
|
|||
|> json_response(200)
|
||||
|
||||
assert account["fields"] == [
|
||||
%{"name" => "foo", "value" => "bar"},
|
||||
%{"name" => "<a href=\"http://google.com\">foo</a>", "value" => "bar"},
|
||||
%{"name" => "link", "value" => ~S(<a href="http://cofe.io" rel="ugc">cofe.io</a>)}
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -457,6 +457,16 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
|||
assert id == to_string(other_user.id)
|
||||
end
|
||||
|
||||
test "cancelling follow request", %{conn: conn} do
|
||||
%{id: other_user_id} = insert(:user, %{locked: true})
|
||||
|
||||
assert %{"id" => ^other_user_id, "following" => false, "requested" => true} =
|
||||
conn |> post("/api/v1/accounts/#{other_user_id}/follow") |> json_response(:ok)
|
||||
|
||||
assert %{"id" => ^other_user_id, "following" => false, "requested" => false} =
|
||||
conn |> post("/api/v1/accounts/#{other_user_id}/unfollow") |> json_response(:ok)
|
||||
end
|
||||
|
||||
test "following without reblogs" do
|
||||
%{conn: conn} = oauth_access(["follow", "read:statuses"])
|
||||
followed = insert(:user)
|
||||
|
|
|
|||
|
|
@ -370,6 +370,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
|||
|
||||
assert NaiveDateTime.diff(NaiveDateTime.from_iso8601!(response["poll"]["expires_at"]), time) in 420..430
|
||||
refute response["poll"]["expred"]
|
||||
|
||||
question = Object.get_by_id(response["poll"]["id"])
|
||||
|
||||
# closed contains utc timezone
|
||||
assert question.data["closed"] =~ "Z"
|
||||
end
|
||||
|
||||
test "option limit is enforced", %{conn: conn} do
|
||||
|
|
|
|||
|
|
@ -368,10 +368,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
|
|||
assert result.pleroma[:settings_store] == nil
|
||||
end
|
||||
|
||||
test "sanitizes display names" do
|
||||
test "doesn't sanitize display names" do
|
||||
user = insert(:user, name: "<marquee> username </marquee>")
|
||||
result = AccountView.render("show.json", %{user: user})
|
||||
refute result.display_name == "<marquee> username </marquee>"
|
||||
assert result.display_name == "<marquee> username </marquee>"
|
||||
end
|
||||
|
||||
test "never display nil user follow counts" do
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationViewTest do
|
|||
NotificationView.render("index.json", %{notifications: [notification], for: follower})
|
||||
end
|
||||
|
||||
test "EmojiReaction notification" do
|
||||
test "EmojiReact notification" do
|
||||
user = insert(:user)
|
||||
other_user = insert(:user)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue