diff options
author | lain <lain@soykaf.club> | 2018-12-01 10:40:01 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-12-01 10:40:01 +0100 |
commit | 347df6421d6b1794a39ac6ce9e24a9e51e136a62 (patch) | |
tree | 5d248ec33932c595f4bd07be2f7adb2630ec2c9a /test/web/mastodon_api/mastodon_api_controller_test.exs | |
parent | c443c9bd72b04b8a24d904bc20fde0d4ffca71d7 (diff) | |
download | pleroma-347df6421d6b1794a39ac6ce9e24a9e51e136a62.tar.gz |
Fix masto api user updating.
Diffstat (limited to 'test/web/mastodon_api/mastodon_api_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index ef9db20cf..7042a6ace 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -1263,6 +1263,18 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do assert user["note"] == "I drink #cofe" end + test "updates the user's locking status", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{locked: "true"}) + + assert user = json_response(conn, 200) + assert user["locked"] == true + end + test "updates the user's name", %{conn: conn} do user = insert(:user) @@ -1289,8 +1301,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> assign(:user, user) |> patch("/api/v1/accounts/update_credentials", %{"avatar" => new_avatar}) - assert user = json_response(conn, 200) - assert user["avatar"] != "https://placehold.it/48x48" + assert user_response = json_response(conn, 200) + assert user_response["avatar"] != User.avatar_url(user) end test "updates the user's banner", %{conn: conn} do @@ -1307,8 +1319,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> assign(:user, user) |> patch("/api/v1/accounts/update_credentials", %{"header" => new_header}) - assert user = json_response(conn, 200) - assert user["header"] != "https://placehold.it/700x335" + assert user_response = json_response(conn, 200) + assert user_response["header"] != User.banner_url(user) end end |