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 "application_system_test_case"
class SessionsTest < ApplicationSystemTestCase
setup do
@user = users(:one)
end
test "should create session" do
visit new_session_url
fill_in "Email", with: @user.email
fill_in "Password", with: "secret"
click_on "Create Session"
assert_text "Session was successfully created"
end
test "should destroy Session" do
visit root_url
click_on "Log out", match: :first
assert_text "Session was successfully destroyed"
end
end