mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Better auth tests
This commit is contained in:
parent
aeba3083df
commit
e1cdcbac0a
@ -64,14 +64,13 @@ defmodule Chess.AuthTest do
|
|||||||
|
|
||||||
test "authenticate_user/1 returns false on incorrect password " do
|
test "authenticate_user/1 returns false on incorrect password " do
|
||||||
user_fixture(username: "link", password: "eyeofsheikah")
|
user_fixture(username: "link", password: "eyeofsheikah")
|
||||||
assert Auth.authenticate_user("link", "shadowtemple") ==
|
assert {:error, message} = Auth.authenticate_user("link", "shadowtemple")
|
||||||
{:error, "invalid password"}
|
assert message == "invalid password"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "authenticate_user/1 returns true on correct password " do
|
test "authenticate_user/1 returns true on correct password " do
|
||||||
user = user_fixture(username: "link", password: "eyeofsheikah")
|
user = user_fixture(username: "link", password: "eyeofsheikah")
|
||||||
assert Auth.authenticate_user("link", "eyeofsheikah") ==
|
assert {:ok, ^user} = Auth.authenticate_user("link", "eyeofsheikah")
|
||||||
{:ok, user}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user