diff options
author | lain <lain@soykaf.club> | 2020-07-01 08:51:56 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-07-01 08:51:56 +0000 |
commit | 691742e62d36831d31ba5623bb0fc5f91d77960a (patch) | |
tree | 996ab789fc0a56db23cc841fd081364989bbe33b | |
parent | 9cf4bfcd818b9631e4352cc30236ef541662c86b (diff) | |
download | pleroma-691742e62d36831d31ba5623bb0fc5f91d77960a.tar.gz |
Revert "Merge branch 'avatar-removing' into 'develop'"
This reverts merge request !2701
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller/update_credentials_test.exs | 47 |
1 files changed, 7 insertions, 40 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 31f0edf97..f67d294ba 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 @@ -216,20 +216,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do filename: "an_image.jpg" } - res = - conn - |> patch("/api/v1/accounts/update_credentials", %{"avatar" => new_avatar}) + conn = patch(conn, "/api/v1/accounts/update_credentials", %{"avatar" => new_avatar}) - assert user_response = json_response_and_validate_schema(res, 200) + assert user_response = json_response_and_validate_schema(conn, 200) assert user_response["avatar"] != User.avatar_url(user) - - # Also removes it - res = - conn - |> patch("/api/v1/accounts/update_credentials", %{"avatar" => nil}) - - assert user_response = json_response_and_validate_schema(res, 200) - assert user_response["avatar"] == User.avatar_url(user) end test "updates the user's banner", %{user: user, conn: conn} do @@ -239,21 +229,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do filename: "an_image.jpg" } - res = - conn - |> patch("/api/v1/accounts/update_credentials", %{"header" => new_header}) + conn = patch(conn, "/api/v1/accounts/update_credentials", %{"header" => new_header}) - assert user_response = json_response_and_validate_schema(res, 200) + assert user_response = json_response_and_validate_schema(conn, 200) assert user_response["header"] != User.banner_url(user) - - # Also removes it - - res = - conn - |> patch("/api/v1/accounts/update_credentials", %{"header" => nil}) - - assert user_response = json_response_and_validate_schema(res, 200) - assert user_response["header"] == User.banner_url(user) end test "updates the user's background", %{conn: conn} do @@ -263,25 +242,13 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do filename: "an_image.jpg" } - res = - conn - |> patch("/api/v1/accounts/update_credentials", %{ + conn = + patch(conn, "/api/v1/accounts/update_credentials", %{ "pleroma_background_image" => new_header }) - assert user_response = json_response_and_validate_schema(res, 200) + assert user_response = json_response_and_validate_schema(conn, 200) assert user_response["pleroma"]["background_image"] - - # Also removes it - - res = - conn - |> patch("/api/v1/accounts/update_credentials", %{ - "pleroma_background_image" => nil - }) - - assert user_response = json_response_and_validate_schema(res, 200) - refute user_response["pleroma"]["background_image"] end test "requires 'write:accounts' permission" do |