Require authentication for most endpoints (#29)

Reviewed-on: #29
This commit is contained in:
Andrew Tomaka 2024-09-08 21:07:51 -04:00
parent 0f95034e8e
commit c64550785e
15 changed files with 84 additions and 11 deletions

View file

@ -6,13 +6,14 @@ class UsersTest < ApplicationSystemTestCase
end
test "visiting the index" do
login(@user.email)
visit users_url
assert_selector "h1", text: "Users"
end
test "should create user" do
visit users_url
click_on "New user"
click_on "Sign up"
fill_in "Email", with: "userthree@example.local"
fill_in "Password", with: "secret"
@ -24,6 +25,7 @@ class UsersTest < ApplicationSystemTestCase
end
test "should update User" do
login(@user.email)
visit user_url(@user)
click_on "Edit this user", match: :first
@ -37,7 +39,8 @@ class UsersTest < ApplicationSystemTestCase
end
test "should destroy User" do
visit user_url(@user)
login(@user.email)
visit user_url(users(:two))
click_on "Destroy this user", match: :first
assert_text "User was successfully destroyed"