Fix OpenAPI spec for preferred_frontend endpoint

The spec was copied from another endpoint, including the operation id,
leading to scrubbing the valid parameters from the request and simply
not working.

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
Paweł Świątkowski 2024-02-03 14:24:03 +01:00 committed by nicole mikołajczyk
commit 8827e51170
3 changed files with 22 additions and 10 deletions

View file

@ -0,0 +1,19 @@
defmodule Pleroma.Web.PleromaAPI.FrontendSettingsControllerTest do
use Pleroma.Web.ConnCase, async: false
import Pleroma.Factory
describe "PUT /api/v1/pleroma/preferred_frontend" do
test "sets a cookie with selected frontend" do
%{conn: conn} = oauth_access(["read"])
response =
conn
|> put_req_header("content-type", "application/json")
|> put("/api/v1/pleroma/preferred_frontend", %{"frontend_name" => "pleroma-fe/stable"})
json_response_and_validate_schema(response, 200)
assert %{"preferred_frontend" => %{value: "pleroma-fe/stable"}} = response.resp_cookies
end
end
end