diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2020-08-05 19:16:48 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2020-08-05 19:16:48 +0300 |
commit | 4672b61106044c3772f58b02d39531b015ad8cca (patch) | |
tree | 0c0844bab5eae07265965b2b6dbd914afc55f9d6 /test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | |
parent | 3116a75e80144dff79232c8676bd28ed285a14d9 (diff) | |
parent | 7755f49e281e4990db5317b33d6b8e0d12982e0c (diff) | |
download | pleroma-4672b61106044c3772f58b02d39531b015ad8cca.tar.gz pleroma-4672b61106044c3772f58b02d39531b015ad8cca.zip |
Merge branch 'develop' into command-available-check
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 = [ |