Change relationship direction of subscriptions

This commit is contained in:
Sadposter 2019-04-05 16:51:45 +01:00 committed by Hannah Ward
commit 9ca91cbb87
12 changed files with 84 additions and 94 deletions

View file

@ -105,8 +105,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"fields" => [],
"pleroma" => %{
"confirmation_pending" => false,
"tags" => [],
"subscribed" => false
"tags" => []
}
}
@ -154,8 +153,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"fields" => [],
"pleroma" => %{
"confirmation_pending" => false,
"tags" => [],
"subscribed" => false
"tags" => []
}
}
@ -204,22 +202,13 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"fields" => [],
"pleroma" => %{
"confirmation_pending" => false,
"tags" => [],
"subscribed" => false
"tags" => []
}
}
assert represented == UserView.render("show.json", %{user: follower, for: user})
end
test "a user that you are subscribed to" do
user = insert(:user)
subscriber = insert(:user)
{:ok, subscriber} = User.subscribe(subscriber, user)
represented = UserView.render("show.json", %{user: user, for: subscriber})
assert represented["pleroma"]["subscribed"] == true
end
test "a user that is a moderator" do
user = insert(:user, %{info: %{is_moderator: true}})
represented = UserView.render("show.json", %{user: user, for: user})
@ -299,8 +288,7 @@ defmodule Pleroma.Web.TwitterAPI.UserViewTest do
"fields" => [],
"pleroma" => %{
"confirmation_pending" => false,
"tags" => [],
"subscribed" => false
"tags" => []
}
}