Add internal (not managable from API) webhooks
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
9d7bdab7a2
commit
6d46aefb7f
7 changed files with 62 additions and 12 deletions
|
|
@ -64,6 +64,20 @@ defmodule Pleroma.Web.AdminAPI.WebhookControllerTest do
|
|||
|
||||
assert %{events: [:"report.created", :"account.created"]} = Webhook.get(id)
|
||||
end
|
||||
|
||||
test "can't edit an internal webhook", %{conn: conn} do
|
||||
%{id: id} =
|
||||
Webhook.create(%{url: "https://example.com/webhook1", events: [], internal: true})
|
||||
|
||||
conn
|
||||
|> put_req_header("content-type", "application/json")
|
||||
|> patch("/api/pleroma/admin/webhooks/#{id}", %{
|
||||
events: ["report.created", "account.created"]
|
||||
})
|
||||
|> json_response_and_validate_schema(:forbidden)
|
||||
|
||||
assert %{events: []} = Webhook.get(id)
|
||||
end
|
||||
end
|
||||
|
||||
describe "DELETE /api/pleroma/admin/webhooks" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue