use BookStack\Notifications\ConfirmEmail;
use Illuminate\Support\Facades\Notification;
-class AuthTest extends TestCase
+class AuthTest extends BrowserKitTest
{
public function test_auth_working()
$settings->put('app-public', 'true');
$this->visit('/')
->seePageIs('/')
- ->see('Sign In');
+ ->see('Log In');
}
public function test_registration_showing()
$this->asAdmin()
->visit('/settings/users')
- ->click('Add new user')
+ ->click('Add New User')
->type($user->name, '#name')
->type($user->email, '#email')
->check('roles[admin]')
public function test_reset_password_flow()
{
+
+ Notification::fake();
+
$this->visit('/login')->click('Forgot Password?')
->seePageIs('/password/email')
]);
+
+ 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', [