mix format
This commit is contained in:
parent
32fbd2e4e3
commit
24bf8c3977
|
@ -164,5 +164,4 @@ def maybe_quote(name) when is_binary(name) do
|
|||
end
|
||||
|
||||
def maybe_quote(name), do: name
|
||||
|
||||
end
|
||||
|
|
|
@ -69,6 +69,7 @@ def request(method, url, body, headers, options) when is_binary(url) do
|
|||
adapter = Application.get_env(:tesla, :adapter)
|
||||
|
||||
client = Tesla.client(adapter_middlewares(adapter), adapter)
|
||||
|
||||
maybe_limit(
|
||||
fn ->
|
||||
request(client, request)
|
||||
|
|
|
@ -96,9 +96,11 @@ defp maybe_validate_tag_presence(cng) do
|
|||
else
|
||||
tag = get_field(cng, :tag)
|
||||
emoji_name = Emoji.stripped_name(content)
|
||||
|
||||
case tag do
|
||||
[%{name: ^emoji_name, type: "Emoji", icon: %{url: _}}] ->
|
||||
cng
|
||||
|
||||
_ ->
|
||||
cng
|
||||
|> add_error(:tag, "does not contain an Emoji tag")
|
||||
|
|
|
@ -10,6 +10,7 @@ defmodule Pleroma.HTTPTest do
|
|||
|
||||
setup do
|
||||
clear_config([:http, :send_user_agent], false)
|
||||
|
||||
mock(fn
|
||||
%{
|
||||
method: :get,
|
||||
|
|
|
@ -73,7 +73,17 @@ test "it works for incoming custom emoji reactions" do
|
|||
object = Object.get_by_ap_id(data["object"])
|
||||
|
||||
assert object.data["reaction_count"] == 1
|
||||
assert match?([["hanapog", _, "https://misskey.local.live/files/webpublic-8f8a9768-7264-4171-88d6-2356aabeadcd"]], object.data["reactions"])
|
||||
|
||||
assert match?(
|
||||
[
|
||||
[
|
||||
"hanapog",
|
||||
_,
|
||||
"https://misskey.local.live/files/webpublic-8f8a9768-7264-4171-88d6-2356aabeadcd"
|
||||
]
|
||||
],
|
||||
object.data["reactions"]
|
||||
)
|
||||
end
|
||||
|
||||
test "it reject invalid emoji reactions" do
|
||||
|
|
|
@ -323,6 +323,7 @@ test "search fetches remote accounts", %{conn: conn} do
|
|||
|> assign(:token, insert(:oauth_token, user: user, scopes: ["read"]))
|
||||
|> get("/api/v1/search?#{query}")
|
||||
|> json_response_and_validate_schema(200)
|
||||
|
||||
[account] = results["accounts"]
|
||||
assert account["acct"] == "mike@osada.macgirvin.com"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue