diff options
| author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-07-09 19:07:07 +0200 | 
|---|---|---|
| committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2020-07-09 19:21:58 +0200 | 
| commit | cc7153cd828afef1564b58649875b5529c078054 (patch) | |
| tree | 01aa0fe95293f8d76e8ae22cd7d91bb5930d00d8 /test/web/mastodon_api/controllers/account_controller | |
| parent | 68036f5a3b7b609f4464650c2ae40b9679d45291 (diff) | |
| download | pleroma-cc7153cd828afef1564b58649875b5529c078054.tar.gz pleroma-cc7153cd828afef1564b58649875b5529c078054.zip | |
user: Add support for custom emojis in profile fields
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller')
| -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 b55bb76a7..ee5ec9053 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 @@ -344,6 +344,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 =          [ | 
