Users can only log into the system when their account is active. I use a factory to create a user (initially their status is set to 'pending') and then try to post to the login form.
From here, I'm not too sure what assertions I need to do. I have already written the code that does this functionality (I have a custom Validator in the validateLogin form) and then it throws an error message something along the lines of 'your account is not active'.
What's the best way to approach this? What I have so far:
/** @test */
public function it_can_only_login_if_the_status_is_active()
{
$user = factory(User::class)->create();
$this->post('login', ['email' => $user->email, 'password' => $user->password, '_token' => csrf_token()]);
}