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()
{
$this->visit('/register')
->type('Andre MacNamara', 'name')
->type('[email protected]', 'email')
->type('Landlord', 'userType')
->type('password', 'password')
->press('Register')
->seePageIs('/register'); }
The form has all the fields above. This is the ouput from the unit test.
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.