+ public function test_login_attempts_are_rate_limited()
+ {
+ for ($i = 0; $i < 5; $i++) {
+ }
+ $resp = $this->followRedirects($resp);
+ $resp->assertSee('These credentials do not match our records.');
+
+ // Check the fifth attempt provides a lockout response
+ $resp->assertSee('Too many login attempts. Please try again in');
+ }
+
+ public function test_login_specifically_disabled_for_guest_account()
+ {
+ $guest = $this->users->guest();
+
+ $resp = $this->post('/login', ['email' => $guest->email, 'password' => 'password']);
+ $resp->assertRedirect('/login');
+ $resp = $this->followRedirects($resp);
+ $resp->assertSee('These credentials do not match our records.');
+
+ // Test login even with password somehow set
+ $guest->password = Hash::make('password');
+ $guest->save();
+
+ $resp = $this->post('/login', ['email' => $guest->email, 'password' => 'password']);
+ $resp->assertRedirect('/login');
+ $resp = $this->followRedirects($resp);
+ $resp->assertSee('These credentials do not match our records.');
+ }
+