diff options
author | Alex Gleason <alex@alexgleason.me> | 2020-07-14 18:56:40 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2020-07-14 18:56:40 -0500 |
commit | 48983e942139a81106416cfbb8d22743b6764053 (patch) | |
tree | 1c11c31848609a9e6b8226bc6ac77d3747e1986a /test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | |
parent | df3d1bf5e57389e41a70676ccab1df81d83e3d74 (diff) | |
parent | 3f65f2ea79644cd8a119fc154c2792994723c7cb (diff) | |
download | pleroma-48983e942139a81106416cfbb8d22743b6764053.tar.gz pleroma-48983e942139a81106416cfbb8d22743b6764053.zip |
Merge remote-tracking branch 'upstream/develop' into by-approval
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs index 638626b45..b888e4c71 100644 --- a/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs +++ b/test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs @@ -351,6 +351,30 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do ] end + test "emojis in fields labels", %{conn: conn} do + fields = [ + %{"name" => ":firefox:", "value" => "is best 2hu"}, + %{"name" => "they wins", "value" => ":blank:"} + ] + + account_data = + conn + |> patch("/api/v1/accounts/update_credentials", %{"fields_attributes" => fields}) + |> json_response_and_validate_schema(200) + + assert account_data["fields"] == [ + %{"name" => ":firefox:", "value" => "is best 2hu"}, + %{"name" => "they wins", "value" => ":blank:"} + ] + + assert account_data["source"]["fields"] == [ + %{"name" => ":firefox:", "value" => "is best 2hu"}, + %{"name" => "they wins", "value" => ":blank:"} + ] + + assert [%{"shortcode" => "blank"}, %{"shortcode" => "firefox"}] = account_data["emojis"] + end + test "update fields via x-www-form-urlencoded", %{conn: conn} do fields = [ |