add accounts doctests
This commit is contained in:
@ -10,6 +10,8 @@ defmodule Lokal.AccountsTest do
|
||||
|
||||
@moduletag :accounts_test
|
||||
|
||||
doctest Accounts, import: true
|
||||
|
||||
describe "get_user_by_email/1" do
|
||||
test "does not return the user if the email does not exist" do
|
||||
refute Accounts.get_user_by_email("unknown@example.com")
|
||||
@ -104,7 +106,7 @@ defmodule Lokal.AccountsTest do
|
||||
|
||||
describe "change_user_registration/2" do
|
||||
test "returns a changeset" do
|
||||
assert %Changeset{} = changeset = Accounts.change_user_registration(%User{})
|
||||
assert %Changeset{} = changeset = Accounts.change_user_registration()
|
||||
assert changeset.required == [:password, :email]
|
||||
end
|
||||
|
||||
@ -112,8 +114,7 @@ defmodule Lokal.AccountsTest do
|
||||
email = unique_user_email()
|
||||
password = valid_user_password()
|
||||
|
||||
changeset =
|
||||
Accounts.change_user_registration(%User{}, %{"email" => email, "password" => password})
|
||||
changeset = Accounts.change_user_registration(%{"email" => email, "password" => password})
|
||||
|
||||
assert changeset.valid?
|
||||
assert get_change(changeset, :email) == email
|
||||
|
Reference in New Issue
Block a user