Change user.confirmation_pending field to user.is_confirmed
This commit is contained in:
parent
cf367fdbd5
commit
d36182c088
29 changed files with 121 additions and 101 deletions
|
|
@ -891,10 +891,10 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|
||||
describe "PATCH /confirm_email" do
|
||||
test "it confirms emails of two users", %{conn: conn, admin: admin} do
|
||||
[first_user, second_user] = insert_pair(:user, confirmation_pending: true)
|
||||
[first_user, second_user] = insert_pair(:user, is_confirmed: false)
|
||||
|
||||
assert first_user.confirmation_pending == true
|
||||
assert second_user.confirmation_pending == true
|
||||
refute first_user.is_confirmed
|
||||
refute second_user.is_confirmed
|
||||
|
||||
ret_conn =
|
||||
patch(conn, "/api/pleroma/admin/users/confirm_email", %{
|
||||
|
|
@ -906,8 +906,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|
||||
assert ret_conn.status == 200
|
||||
|
||||
assert first_user.confirmation_pending == true
|
||||
assert second_user.confirmation_pending == true
|
||||
assert User.get_by_id(first_user.id).is_confirmed
|
||||
assert User.get_by_id(second_user.id).is_confirmed
|
||||
|
||||
log_entry = Repo.one(ModerationLog)
|
||||
|
||||
|
|
@ -920,7 +920,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|
||||
describe "PATCH /resend_confirmation_email" do
|
||||
test "it resend emails for two users", %{conn: conn, admin: admin} do
|
||||
[first_user, second_user] = insert_pair(:user, confirmation_pending: true)
|
||||
[first_user, second_user] = insert_pair(:user, is_confirmed: false)
|
||||
|
||||
ret_conn =
|
||||
patch(conn, "/api/pleroma/admin/users/resend_confirmation_email", %{
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ defmodule Pleroma.Web.AdminAPI.StatusControllerTest do
|
|||
assert account["id"] == actor.id
|
||||
assert account["nickname"] == actor.nickname
|
||||
assert account["deactivated"] == actor.deactivated
|
||||
assert account["confirmation_pending"] == actor.confirmation_pending
|
||||
assert account["is_confirmed"] == actor.is_confirmed
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -635,11 +635,11 @@ defmodule Pleroma.Web.AdminAPI.UserControllerTest do
|
|||
end
|
||||
|
||||
test "only unconfirmed users", %{conn: conn} do
|
||||
sad_user = insert(:user, nickname: "sadboy", confirmation_pending: true)
|
||||
old_user = insert(:user, nickname: "oldboy", confirmation_pending: true)
|
||||
sad_user = insert(:user, nickname: "sadboy", is_confirmed: false)
|
||||
old_user = insert(:user, nickname: "oldboy", is_confirmed: false)
|
||||
|
||||
insert(:user, nickname: "happyboy", approval_pending: false)
|
||||
insert(:user, confirmation_pending: false)
|
||||
insert(:user, is_confirmed: true)
|
||||
|
||||
result =
|
||||
conn
|
||||
|
|
@ -649,7 +649,7 @@ defmodule Pleroma.Web.AdminAPI.UserControllerTest do
|
|||
users =
|
||||
Enum.map([old_user, sad_user], fn user ->
|
||||
user_response(user, %{
|
||||
"confirmation_pending" => true,
|
||||
"is_confirmed" => false,
|
||||
"approval_pending" => false
|
||||
})
|
||||
end)
|
||||
|
|
@ -960,7 +960,7 @@ defmodule Pleroma.Web.AdminAPI.UserControllerTest do
|
|||
"tags" => [],
|
||||
"avatar" => User.avatar_url(user) |> MediaProxy.url(),
|
||||
"display_name" => HTML.strip_tags(user.name || user.nickname),
|
||||
"confirmation_pending" => false,
|
||||
"is_confirmed" => true,
|
||||
"approval_pending" => false,
|
||||
"url" => user.ap_id,
|
||||
"registration_reason" => nil,
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ defmodule Pleroma.Web.AdminAPI.SearchTest do
|
|||
end
|
||||
|
||||
test "it returns unconfirmed user" do
|
||||
unconfirmed = insert(:user, confirmation_pending: true)
|
||||
unconfirmed = insert(:user, is_confirmed: false)
|
||||
insert(:user)
|
||||
insert(:user)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue