mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-22 17:27:18 +00:00
Use a custom oauth token so we can predict and validate the client_name and website
This commit is contained in:
parent
4b979538bc
commit
bd3d0e8b57
|
@ -358,7 +358,16 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
||||||
assert activity.data["cc"] == []
|
assert activity.data["cc"] == []
|
||||||
end
|
end
|
||||||
|
|
||||||
test "preserves client application metadata", %{conn: conn} do
|
test "preserves client application metadata" do
|
||||||
|
%{user: _user, token: token, conn: conn} = oauth_access(["write:statuses"])
|
||||||
|
|
||||||
|
%Pleroma.Web.OAuth.Token{
|
||||||
|
app: %Pleroma.Web.OAuth.App{
|
||||||
|
client_name: _app_name,
|
||||||
|
website: _app_website
|
||||||
|
}
|
||||||
|
} = token
|
||||||
|
|
||||||
result =
|
result =
|
||||||
conn
|
conn
|
||||||
|> put_req_header("content-type", "application/json")
|
|> put_req_header("content-type", "application/json")
|
||||||
|
@ -369,8 +378,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
|
||||||
assert %{
|
assert %{
|
||||||
"content" => "cofe is my copilot",
|
"content" => "cofe is my copilot",
|
||||||
"application" => %{
|
"application" => %{
|
||||||
"name" => "Some client 0",
|
"name" => app_name,
|
||||||
"website" => "https://example.com"
|
"website" => app_website
|
||||||
}
|
}
|
||||||
} = json_response_and_validate_schema(result, 200)
|
} = json_response_and_validate_schema(result, 200)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue