1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Better auth tests

This commit is contained in:
Daniel Barber 2018-01-15 22:24:23 -05:00
parent aeba3083df
commit e1cdcbac0a
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -64,14 +64,13 @@ defmodule Chess.AuthTest do
test "authenticate_user/1 returns false on incorrect password " do
user_fixture(username: "link", password: "eyeofsheikah")
assert Auth.authenticate_user("link", "shadowtemple") ==
{:error, "invalid password"}
assert {:error, message} = Auth.authenticate_user("link", "shadowtemple")
assert message == "invalid password"
end
test "authenticate_user/1 returns true on correct password " do
user = user_fixture(username: "link", password: "eyeofsheikah")
assert Auth.authenticate_user("link", "eyeofsheikah") ==
{:ok, user}
assert {:ok, ^user} = Auth.authenticate_user("link", "eyeofsheikah")
end
end
end