]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/AuthTest.php
Modernize third party services' logos
[bookstack] / tests / Auth / AuthTest.php
index d83f25557007561816986cd16d2a13560eb0dd6e..79f00bed093cbd28c0c550820e41e76a0b799133 100644 (file)
@@ -282,6 +282,22 @@ class AuthTest extends TestCase
             ->assertElementContains('a', 'Sign up');
     }
 
+    public function test_reset_password_request_is_throttled()
+    {
+        $editor = $this->getEditor();
+        Notification::fake();
+        $this->get('/password/email');
+        $this->followingRedirects()->post('/password/email', [
+            'email' => $editor->email,
+        ]);
+
+        $resp = $this->followingRedirects()->post('/password/email', [
+            'email' => $editor->email,
+        ]);
+        Notification::assertTimesSent(1, ResetPassword::class);
+        $resp->assertSee('A password reset link will be sent to ' . $editor->email . ' if that email address is found in the system.');
+    }
+
     public function test_login_redirects_to_initially_requested_url_correctly()
     {
         config()->set('app.url', 'http://localhost');