Setup user login/logout (#21)

Reviewed-on: #21
This commit is contained in:
Andrew Tomaka 2024-08-01 21:41:42 -04:00
parent a70c656690
commit 4d3971113f
13 changed files with 196 additions and 0 deletions

View file

@ -0,0 +1,25 @@
require "test_helper"
class SessionTest < ActiveSupport::TestCase
def test_save_when_exists
user = users(:one)
session = Session.new(email: user.email, password: "secret")
assert session.save
end
def test_save_when_not_exists
session = Session.new(email: "fake@example.org", password: "secret")
assert_not session.save
end
def test_save_when_password_incorrect
user = users(:one)
session = Session.new(email: user.email, password: "bad_password")
assert_not session.save
end
end