summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-02-11 15:53:10 -0600
committerMark Felder <feld@feld.me>2021-02-11 15:53:10 -0600
commitbd3d0e8b57f6a27b8c833d11f4b98d4dbfd846ad (patch)
tree890917587644573c6f0659bc2d5cc4b095e51ffa
parent4b979538bcc0861ed81b6af72bbe48af07425c18 (diff)
Use a custom oauth token so we can predict and validate the client_name and website
-rw-r--r--test/pleroma/web/mastodon_api/controllers/status_controller_test.exs15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
index fada7c25c..1ca829544 100644
--- a/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
@@ -358,7 +358,16 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert activity.data["cc"] == []
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 =
conn
|> put_req_header("content-type", "application/json")
@@ -369,8 +378,8 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
assert %{
"content" => "cofe is my copilot",
"application" => %{
- "name" => "Some client 0",
- "website" => "https://example.com"
+ "name" => app_name,
+ "website" => app_website
}
} = json_response_and_validate_schema(result, 200)
end