]> BookStack Code Mirror - bookstack/blobdiff - tests/Auth/AuthTest.php
Upgraded to Laravel 5.4
[bookstack] / tests / Auth / AuthTest.php
index 664ec297a0bff766368b4d5c92d1ec6bb11fee42..f7595883853aee417e87d08c489beef6e55a4269 100644 (file)
@@ -3,7 +3,7 @@
 use BookStack\Notifications\ConfirmEmail;
 use Illuminate\Support\Facades\Notification;
 
-class AuthTest extends TestCase
+class AuthTest extends BrowserKitTest
 {
 
     public function test_auth_working()
@@ -220,6 +220,9 @@ class AuthTest extends TestCase
 
     public function test_reset_password_flow()
     {
+
+        Notification::fake();
+
         $this->visit('/login')->click('Forgot Password?')
             ->seePageIs('/password/email')
             ->type('[email protected]', 'email')
@@ -230,8 +233,13 @@ class AuthTest extends TestCase
             'email' => '[email protected]'
         ]);
 
+        $user = \BookStack\User::where('email', '=', '[email protected]')->first();
+
+        Notification::assertSentTo($user, \BookStack\Notifications\ResetPassword::class);
+        $n = Notification::sent($user, \BookStack\Notifications\ResetPassword::class);
+
         $reset = DB::table('password_resets')->where('email', '=', '[email protected]')->first();
-        $this->visit('/password/reset/' . $reset->token)
+        $this->visit('/password/reset/' . $n->first()->token)
             ->see('Reset Password')
             ->submitForm('Reset Password', [
                 'email' => '[email protected]',