Fix api spec and tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
bda8589f16
commit
47271b50a1
7 changed files with 25 additions and 20 deletions
|
@ -96,7 +96,16 @@ def spec(opts \\ []) do
|
|||
"Report managment",
|
||||
"Status administration",
|
||||
"User administration",
|
||||
"Announcement management"
|
||||
"Announcement management",
|
||||
"Instance rule managment",
|
||||
"Webhooks"
|
||||
]
|
||||
},
|
||||
%{
|
||||
"name" => "Administration (MastoAPI)",
|
||||
"tags" => [
|
||||
"User administration",
|
||||
"Report methods"
|
||||
]
|
||||
},
|
||||
%{"name" => "Applications", "tags" => ["Applications", "Push subscriptions"]},
|
||||
|
@ -129,7 +138,8 @@ def spec(opts \\ []) do
|
|||
"Scheduled statuses",
|
||||
"Search",
|
||||
"Status actions",
|
||||
"Media attachments"
|
||||
"Media attachments",
|
||||
"Event actions"
|
||||
]
|
||||
},
|
||||
%{
|
||||
|
|
|
@ -224,7 +224,7 @@ def post_chat_message_operation do
|
|||
|
||||
def delete_operation do
|
||||
%Operation{
|
||||
tags: ["chat"],
|
||||
tags: ["Chats"],
|
||||
summary: "delete",
|
||||
operationId: "ChatController.delete",
|
||||
parameters: [
|
||||
|
|
|
@ -25,7 +25,7 @@ def show_operation do
|
|||
|
||||
def show2_operation do
|
||||
%Operation{
|
||||
tags: ["Instance"],
|
||||
tags: ["Instance misc"],
|
||||
summary: "Retrieve instance information",
|
||||
description: "Information about the server",
|
||||
operationId: "InstanceController.show2",
|
||||
|
@ -48,7 +48,7 @@ def peers_operation do
|
|||
|
||||
def rules_operation do
|
||||
%Operation{
|
||||
tags: ["Instance"],
|
||||
tags: ["Instance misc"],
|
||||
summary: "Retrieve list of instance rules",
|
||||
operationId: "InstanceController.rules",
|
||||
responses: %{
|
||||
|
@ -59,7 +59,7 @@ def rules_operation do
|
|||
|
||||
def domain_blocks_operation do
|
||||
%Operation{
|
||||
tags: ["Instance"],
|
||||
tags: ["Instance misc"],
|
||||
summary: "Retrieve instance domain blocks",
|
||||
operationId: "InstanceController.domain_blocks",
|
||||
responses: %{
|
||||
|
|
|
@ -2727,8 +2727,6 @@ test "returns fully qualified nickname for local users" do
|
|||
test "returns fully qualified nickname for local users when using different domain for webfinger" do
|
||||
clear_config([Pleroma.Web.WebFinger, :domain], "plemora.dev")
|
||||
|
||||
host = Pleroma.Web.Endpoint.host()
|
||||
|
||||
local_user = insert(:user, nickname: "local_user")
|
||||
|
||||
assert User.full_nickname(local_user) == "local_user@plemora.dev"
|
||||
|
|
|
@ -2229,7 +2229,7 @@ test "it returns 404 if the user cannot see the post", %{conn: conn} do
|
|||
|
||||
test "it translates a status to user language" do
|
||||
user = insert(:user, language: "fr")
|
||||
%{conn: conn, user: user} = oauth_access(["read:statuses"], user: user)
|
||||
%{conn: conn} = oauth_access(["read:statuses"], user: user)
|
||||
another_user = insert(:user)
|
||||
|
||||
{:ok, activity} =
|
||||
|
@ -2252,7 +2252,7 @@ test "it translates a status to user language" do
|
|||
end
|
||||
|
||||
test "it returns an error if no target language provided" do
|
||||
%{conn: conn, user: user} = oauth_access(["read:statuses"])
|
||||
%{conn: conn} = oauth_access(["read:statuses"])
|
||||
another_user = insert(:user)
|
||||
|
||||
{:ok, activity} =
|
||||
|
@ -2261,10 +2261,9 @@ test "it returns an error if no target language provided" do
|
|||
language: "pl"
|
||||
})
|
||||
|
||||
response =
|
||||
conn
|
||||
|> post("/api/v1/statuses/#{activity.id}/translate")
|
||||
|> json_response_and_validate_schema(400)
|
||||
conn
|
||||
|> post("/api/v1/statuses/#{activity.id}/translate")
|
||||
|> json_response_and_validate_schema(400)
|
||||
end
|
||||
|
||||
test "it doesn't translate non-public statuses" do
|
||||
|
@ -2277,10 +2276,9 @@ test "it doesn't translate non-public statuses" do
|
|||
language: "pl"
|
||||
})
|
||||
|
||||
response =
|
||||
conn
|
||||
|> post("/api/v1/statuses/#{activity.id}/translate")
|
||||
|> json_response_and_validate_schema(404)
|
||||
conn
|
||||
|> post("/api/v1/statuses/#{activity.id}/translate")
|
||||
|> json_response_and_validate_schema(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -175,7 +175,7 @@ test "don't display requests if not an author", %{conn: conn} do
|
|||
[user: user, conn: conn]
|
||||
end
|
||||
|
||||
test "joins an event", %{conn: conn, user: user} do
|
||||
test "joins an event", %{conn: conn} do
|
||||
other_user = insert(:user)
|
||||
|
||||
{:ok, activity} =
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
defmodule Pleroma.WebhookTest do
|
||||
use Pleroma.DataCase, async: true
|
||||
|
||||
alias Pleroma.Repo
|
||||
alias Pleroma.Webhook
|
||||
|
||||
test "creating a webhook" do
|
||||
|
|
Loading…
Reference in a new issue