diff options
| author | lain <lain@soykaf.club> | 2019-09-30 13:57:54 +0200 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2019-09-30 13:57:54 +0200 | 
| commit | b923842e96e821afeb7bbfa0d098b9c5698281c5 (patch) | |
| tree | 37d84255d7b97fc411f5c78378565a8f205a2120 /test/web/mastodon_api/controllers/mastodon_api_controller | |
| parent | 6fe2f554c36be1ef03ac1d1104a78d0686f48a26 (diff) | |
| parent | 74d8fadf3745a4b4203c2cead35b741554ccc439 (diff) | |
| download | pleroma-b923842e96e821afeb7bbfa0d098b9c5698281c5.tar.gz pleroma-b923842e96e821afeb7bbfa0d098b9c5698281c5.zip | |
Merge remote-tracking branch 'origin/develop' into reactions
Diffstat (limited to 'test/web/mastodon_api/controllers/mastodon_api_controller')
| -rw-r--r-- | test/web/mastodon_api/controllers/mastodon_api_controller/update_credentials_test.exs | 25 | 
1 files changed, 20 insertions, 5 deletions
| diff --git a/test/web/mastodon_api/controllers/mastodon_api_controller/update_credentials_test.exs b/test/web/mastodon_api/controllers/mastodon_api_controller/update_credentials_test.exs index 87ee82050..560f55137 100644 --- a/test/web/mastodon_api/controllers/mastodon_api_controller/update_credentials_test.exs +++ b/test/web/mastodon_api/controllers/mastodon_api_controller/update_credentials_test.exs @@ -86,10 +86,9 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do        assert user = json_response(conn, 200)        assert user["note"] == -               ~s(I drink <a class="hashtag" data-tag="cofe" href="http://localhost:4001/tag/cofe" rel="tag">#cofe</a> with <span class="h-card"><a data-user=") <> -                 user2.id <> -                 ~s(" class="u-url mention" href=") <> -                 user2.ap_id <> ~s(">@<span>) <> user2.nickname <> ~s(</span></a></span>) +               ~s(I drink <a class="hashtag" data-tag="cofe" href="http://localhost:4001/tag/cofe">#cofe</a> with <span class="h-card"><a data-user="#{ +                 user2.id +               }" class="u-url mention" href="#{user2.ap_id}" rel="ugc">@<span>#{user2.nickname}</span></a></span>)      end      test "updates the user's locking status", %{conn: conn} do @@ -128,6 +127,22 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do        assert user["pleroma"]["hide_followers"] == true      end +    test "updates the user's hide_followers_count and hide_follows_count", %{conn: conn} do +      user = insert(:user) + +      conn = +        conn +        |> assign(:user, user) +        |> patch("/api/v1/accounts/update_credentials", %{ +          hide_followers_count: "true", +          hide_follows_count: "true" +        }) + +      assert user = json_response(conn, 200) +      assert user["pleroma"]["hide_followers_count"] == true +      assert user["pleroma"]["hide_follows_count"] == true +    end +      test "updates the user's skip_thread_containment option", %{conn: conn} do        user = insert(:user) @@ -318,7 +333,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do        assert account["fields"] == [                 %{"name" => "foo", "value" => "bar"}, -               %{"name" => "link", "value" => "<a href=\"http://cofe.io\">cofe.io</a>"} +               %{"name" => "link", "value" => ~S(<a href="http://cofe.io" rel="ugc">cofe.io</a>)}               ]        assert account["source"]["fields"] == [ | 
