Notes Used to Craft this Lesson
What we want to do now is write a test for the sad path where our unauthenticated user is blocked from accessing the page because our authentication middleware is protecting the route.
test("not allow an unauthenticated user to view the page", async ({
assert,
client,
route,
}) => {
const response = await client.get(route("settings.account"));
response.assertOk();
response.assertTextIncludes("Unauthorized access");
});