forked from AkkomaGang/akkoma
[#114] Added pleroma.confirmation_pending
to user views, adjusted view tests.
This commit is contained in:
parent
b86057cc7f
commit
aed0f90287
4 changed files with 26 additions and 6 deletions
|
@ -62,6 +62,7 @@ def render("account.json", %{user: user} = opts) do
|
||||||
|
|
||||||
# Pleroma extension
|
# Pleroma extension
|
||||||
pleroma: %{
|
pleroma: %{
|
||||||
|
confirmation_pending: user_info.confirmation_pending,
|
||||||
tags: user.tags
|
tags: user.tags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,7 @@ def render("user.json", %{user: user = %User{}} = assigns) do
|
||||||
|
|
||||||
# Pleroma extension
|
# Pleroma extension
|
||||||
"pleroma" => %{
|
"pleroma" => %{
|
||||||
|
"confirmation_pending" => user_info.confirmation_pending,
|
||||||
"tags" => user.tags
|
"tags" => user.tags
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,10 @@ test "Represent a user account" do
|
||||||
privacy: "public",
|
privacy: "public",
|
||||||
sensitive: false
|
sensitive: false
|
||||||
},
|
},
|
||||||
pleroma: %{tags: []}
|
pleroma: %{
|
||||||
|
confirmation_pending: false,
|
||||||
|
tags: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert expected == AccountView.render("account.json", %{user: user})
|
assert expected == AccountView.render("account.json", %{user: user})
|
||||||
|
@ -93,7 +96,10 @@ test "Represent a Service(bot) account" do
|
||||||
privacy: "public",
|
privacy: "public",
|
||||||
sensitive: false
|
sensitive: false
|
||||||
},
|
},
|
||||||
pleroma: %{tags: []}
|
pleroma: %{
|
||||||
|
confirmation_pending: false,
|
||||||
|
tags: []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert expected == AccountView.render("account.json", %{user: user})
|
assert expected == AccountView.render("account.json", %{user: user})
|
||||||
|
|
|
@ -96,7 +96,10 @@ test "A user" do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"pleroma" => %{"tags" => []}
|
"pleroma" => %{
|
||||||
|
"confirmation_pending" => false,
|
||||||
|
"tags" => []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: user})
|
assert represented == UserView.render("show.json", %{user: user})
|
||||||
|
@ -138,7 +141,10 @@ test "A user for a given other follower", %{user: user} do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"pleroma" => %{"tags" => []}
|
"pleroma" => %{
|
||||||
|
"confirmation_pending" => false,
|
||||||
|
"tags" => []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: user, for: follower})
|
assert represented == UserView.render("show.json", %{user: user, for: follower})
|
||||||
|
@ -181,7 +187,10 @@ test "A user that follows you", %{user: user} do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"pleroma" => %{"tags" => []}
|
"pleroma" => %{
|
||||||
|
"confirmation_pending" => false,
|
||||||
|
"tags" => []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert represented == UserView.render("show.json", %{user: follower, for: user})
|
assert represented == UserView.render("show.json", %{user: follower, for: user})
|
||||||
|
@ -231,7 +240,10 @@ test "A blocked user for the blocker" do
|
||||||
"default_scope" => "public",
|
"default_scope" => "public",
|
||||||
"no_rich_text" => false,
|
"no_rich_text" => false,
|
||||||
"fields" => [],
|
"fields" => [],
|
||||||
"pleroma" => %{"tags" => []}
|
"pleroma" => %{
|
||||||
|
"confirmation_pending" => false,
|
||||||
|
"tags" => []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
blocker = Repo.get(User, blocker.id)
|
blocker = Repo.get(User, blocker.id)
|
||||||
|
|
Loading…
Reference in a new issue