Lint, fix test

This commit is contained in:
Alex Gleason 2020-07-27 19:19:14 -05:00
parent 520dce857e
commit f43518eb74
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 12 additions and 5 deletions

View file

@ -1553,8 +1553,12 @@ defp delete_or_deactivate(%User{local: true} = user) do
status = account_status(user) status = account_status(user)
case status do case status do
:confirmation_pending -> delete_and_invalidate_cache(user) :confirmation_pending ->
:approval_pending -> delete_and_invalidate_cache(user) delete_and_invalidate_cache(user)
:approval_pending ->
delete_and_invalidate_cache(user)
_ -> _ ->
user user
|> change(%{deactivated: true, email: nil}) |> change(%{deactivated: true, email: nil})

View file

@ -572,7 +572,10 @@ test "it restricts length of registration reason" do
params = params =
@full_user_data @full_user_data
|> Map.put(:registration_reason, "Quia et nesciunt dolores numquam ipsam nisi sapiente soluta. Ullam repudiandae nisi quam porro officiis officiis ad. Consequatur animi velit ex quia. Odit voluptatem perferendis quia ut nisi. Dignissimos sit soluta atque aliquid dolorem ut dolorum ut. Labore voluptates iste iusto amet voluptatum earum. Ad fugit illum nam eos ut nemo. Pariatur ea fuga non aspernatur. Dignissimos debitis officia corporis est nisi ab et. Atque itaque alias eius voluptas minus. Accusamus numquam tempore occaecati in.") |> Map.put(
:registration_reason,
"Quia et nesciunt dolores numquam ipsam nisi sapiente soluta. Ullam repudiandae nisi quam porro officiis officiis ad. Consequatur animi velit ex quia. Odit voluptatem perferendis quia ut nisi. Dignissimos sit soluta atque aliquid dolorem ut dolorum ut. Labore voluptates iste iusto amet voluptatum earum. Ad fugit illum nam eos ut nemo. Pariatur ea fuga non aspernatur. Dignissimos debitis officia corporis est nisi ab et. Atque itaque alias eius voluptas minus. Accusamus numquam tempore occaecati in."
)
changeset = User.register_changeset(%User{}, params) changeset = User.register_changeset(%User{}, params)

View file

@ -1017,7 +1017,7 @@ test "Account registration via app with account_approval_required", %{conn: conn
password: "PlzDontHackLain", password: "PlzDontHackLain",
bio: "Test Bio", bio: "Test Bio",
agreement: true, agreement: true,
reason: "I'm a cool dude, bro" reason: "I am a cool dude, bro"
}) })
%{ %{
@ -1035,7 +1035,7 @@ test "Account registration via app with account_approval_required", %{conn: conn
assert token_from_db.user.confirmation_pending assert token_from_db.user.confirmation_pending
assert token_from_db.user.approval_pending assert token_from_db.user.approval_pending
assert token_from_db.user.registration_reason == "I'm a cool dude, bro" assert token_from_db.user.registration_reason == "I am a cool dude, bro"
end end
test "returns error when user already registred", %{conn: conn, valid_params: valid_params} do test "returns error when user already registred", %{conn: conn, valid_params: valid_params} do