In this video we're going to try to write out a test just to make sure that a user cannot sign up at
the same email twice in a row.
So I'm gonna go back over to my sign up test file.
I'm down at the very bottom.
I'm gonna write out a new block and I'll give it a description like it disallows duplicate emails
than inside of here.
We'll attempt to sign up the same email and password combination twice in a row.
The first request we will expect to give us back a response of 2 0 1 which indicates that the sign up
was successful as we did back up here.
Well then duplicate that request once again.
And on the second request we'll just expect to get back a four hundred.
Because remember if an email is already in use we throw a bad request error which is going to send a
200 or a 400 says code back to the user so inside that new block we'll do it in await request on app.
We'll make a post request to API users sign up.
We will send along an email test at test dot com and a password of password.
And then finally we'll put on an expectation.
So in this case again the first request sign up should be successful.
So we should get back to a 1.
Now we can duplicate that total copy paste it down and then on the second one all we're going to expect
different is a responsive four hundred or a status code of 400.
They'll put in 400 instead.
Let's save that.
Check the terminal where's my test window here this looks good.
All right.
There are a couple of more tests I'd like to put together very quickly.
So quick pass one or two more tests in the next video.