Loading
Current section: Authenticated Integration 5 exercises
Problem

Testing Authenticated Requests and Connection Creation

Loading exercise

Transcript

00:00 So far we've tested the situation where things fail to authenticate and we've also tested the situation down here where we send the user to onboarding. But now we're going to test when a user is logged in, it creates a connection. So we need to create an authenticated request.

00:18 So this request needs to have all of the cookies necessary or the cookie for the session to identify a living and existing session. So you're going to be creating a real session in the actual database and then verifying

00:34 that that session or that way our source code can verify that that session exists. And if that session does exist, this user ID will exist and we'll end up in this situation right here. So this is the portion of the code that we're going to be testing. We want to verify that when a user is logged in, it creates this connection.

00:54 So you're going to be making an assertion about that too. So a couple of things we're going to be doing in this one, I think you'll have a fun time with it. Have a good time.