Acceptable Unit Test?

Published 3 months ago by andremac96

Is this an acceptable test? I have a user model with the following fields. Name, Email, Password and UserType. I'm testing the register page. This is the testing code

public function testExample()
    ->type('Andre MacNamara', 'name') 
    ->type('[email protected]', 'email') 
    ->type('Landlord', 'userType') 
    ->type('password', 'password') 
    ->seePageIs('/register'); }

The form has all the fields above. This is the ouput from the unit test.



Almost there.....

You could be redirected back to /register with an error, or you could be on the other end of the registration with a thank you message (you're not checking for anything but the address and the formFields should exist).

I would check if the User has been inserted into the DB at this point.

Please sign in or create an account to participate in this conversation.