-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
33 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
defmodule Core.UserTest do | ||
use ExUnit.Case | ||
|
||
alias GoEscuelaLms.Core.Schema.User | ||
|
||
describe "users" do | ||
@valid_attrs %{ | ||
full_name: "Jhon doe", | ||
email: "[email protected]", | ||
password_hash: "pass123", | ||
role: "student" | ||
} | ||
@invalid_attrs %{} | ||
|
||
test "create/1 with valid data creates a user" do | ||
assert {:ok, %User{} = user} = User.create(@valid_attrs) | ||
assert user.full_name == "Jhon doe" | ||
assert user.email == "[email protected]" | ||
end | ||
|
||
test "create_user/1 with invalid data returns error changeset" do | ||
assert {:error, %Ecto.Changeset{}} = User.create(@invalid_attrs) | ||
end | ||
|
||
test "email must be valid" do | ||
attrs = %{@valid_attrs | email: "example"} | ||
changeset = User.changeset(%User{}, attrs) | ||
refute changeset.valid? | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
defmodule CoreTest do | ||
use ExUnit.Case | ||
doctest Core | ||
|
||
test "greets the world" do | ||
assert Core.hello() == :world | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.