diff options
author | kPherox <admin@mail.kr-kp.com> | 2019-08-26 03:25:06 +0900 |
---|---|---|
committer | kPherox <admin@mail.kr-kp.com> | 2019-08-26 03:30:31 +0900 |
commit | b8777b01aeb4656e74437c1ac4916d2fcbe7f39e (patch) | |
tree | 8d8e135b9e6188b1891696c2a232d1e8d5e2751f | |
parent | b15e226593d4d9d58898af5576d2a7e96bed59ae (diff) | |
download | pleroma-b8777b01aeb4656e74437c1ac4916d2fcbe7f39e.tar.gz |
Update test for custom fields when name empty string
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs b/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs index b1a5c2aea..21dae98fa 100644 --- a/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs @@ -364,6 +364,21 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do |> assign(:user, user) |> patch("/api/v1/accounts/update_credentials", %{"fields_attributes" => fields}) |> json_response(403) + + fields = [ + %{"name" => "foo", "value" => ""}, + %{"name" => "", "value" => "bar"} + ] + + account = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{"fields_attributes" => fields}) + |> json_response(200) + + assert account["fields"] == [ + %{"name" => "foo", "value" => ""} + ] end end end |