hide_followings was renamed to hide_followers in the FE, but never synced up in the BE

This was a dirty regex replace which worked on my server
This commit is contained in:
Mark Felder 2019-02-06 22:34:44 +00:00
commit 74518d0b60
9 changed files with 27 additions and 27 deletions

View file

@ -441,8 +441,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
assert result["first"]["orderedItems"] == [user_two.ap_id]
end
test "it returns returns empty if the user has 'hide_followings' set", %{conn: conn} do
user = insert(:user, %{info: %{hide_followings: true}})
test "it returns returns empty if the user has 'hide_follows' set", %{conn: conn} do
user = insert(:user, %{info: %{hide_follows: true}})
user_two = insert(:user)
User.follow(user, user_two)

View file

@ -1139,8 +1139,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert id == to_string(other_user.id)
end
test "getting following, hide_followings", %{conn: conn} do
user = insert(:user, %{info: %{hide_followings: true}})
test "getting following, hide_follows", %{conn: conn} do
user = insert(:user, %{info: %{hide_follows: true}})
other_user = insert(:user)
{:ok, user} = User.follow(user, other_user)
@ -1151,8 +1151,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do
assert [] == json_response(conn, 200)
end
test "getting following, hide_followings, same user requesting", %{conn: conn} do
user = insert(:user, %{info: %{hide_followings: true}})
test "getting following, hide_follows, same user requesting", %{conn: conn} do
user = insert(:user, %{info: %{hide_follows: true}})
other_user = insert(:user)
{:ok, user} = User.follow(user, other_user)

View file

@ -1261,8 +1261,8 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
)
end
test "it returns empty when hide_followings is set to true", %{conn: conn} do
user = insert(:user, %{info: %{hide_followings: true}})
test "it returns empty when hide_follows is set to true", %{conn: conn} do
user = insert(:user, %{info: %{hide_follows: true}})
followed_one = insert(:user)
followed_two = insert(:user)
not_followed = insert(:user)
@ -1278,11 +1278,11 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
assert [] == json_response(conn, 200)
end
test "it returns friends when hide_followings is set to true if the user themselves request it",
test "it returns friends when hide_follows is set to true if the user themselves request it",
%{
conn: conn
} do
user = insert(:user, %{info: %{hide_followings: true}})
user = insert(:user, %{info: %{hide_follows: true}})
followed_one = insert(:user)
followed_two = insert(:user)
_not_followed = insert(:user)
@ -1370,27 +1370,27 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
assert json_response(conn, 200) == UserView.render("user.json", %{user: user, for: user})
end
test "it sets and un-sets hide_followings", %{conn: conn} do
test "it sets and un-sets hide_follows", %{conn: conn} do
user = insert(:user)
conn
|> assign(:user, user)
|> post("/api/account/update_profile.json", %{
"hide_followings" => "true"
"hide_follows" => "true"
})
user = Repo.get!(User, user.id)
assert user.info.hide_followings == true
assert user.info.hide_follows == true
conn =
conn
|> assign(:user, user)
|> post("/api/account/update_profile.json", %{
"hide_followings" => "false"
"hide_follows" => "false"
})
user = Repo.get!(User, user.id)
assert user.info.hide_followings == false
assert user.info.hide_follows == false
assert json_response(conn, 200) == UserView.render("user.json", %{user: user, for: user})
end

View file

@ -100,7 +100,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"locked" => false,
"default_scope" => "public",
"no_rich_text" => false,
"hide_followings" => false,
"hide_follows" => false,
"hide_followers" => false,
"fields" => [],
"pleroma" => %{
@ -148,7 +148,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"locked" => false,
"default_scope" => "public",
"no_rich_text" => false,
"hide_followings" => false,
"hide_follows" => false,
"hide_followers" => false,
"fields" => [],
"pleroma" => %{
@ -197,7 +197,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"locked" => false,
"default_scope" => "public",
"no_rich_text" => false,
"hide_followings" => false,
"hide_follows" => false,
"hide_followers" => false,
"fields" => [],
"pleroma" => %{
@ -276,7 +276,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"locked" => false,
"default_scope" => "public",
"no_rich_text" => false,
"hide_followings" => false,
"hide_follows" => false,
"hide_followers" => false,
"fields" => [],
"pleroma" => %{