$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_user_updating()
{
- $user = \BookStack\User::all()->last();
+ $user = $this->getNormalUser();
$password = $user->password;
$this->asAdmin()
->visit('/settings/users')
public function test_user_password_update()
{
- $user = \BookStack\User::all()->last();
+ $user = $this->getNormalUser();
$userProfilePage = '/settings/users/' . $user->id;
$this->asAdmin()
->visit($userProfilePage)
->seePageIs('/login');
}
+ public function test_reset_password_flow()
+ {
+ $this->visit('/login')->click('Forgot Password?')
+ ->seePageIs('/password/email')
+ ->press('Send Reset Link')
+
+ $this->seeInDatabase('password_resets', [
+ ]);
+
+ $reset = DB::table('password_resets')->where('email', '=', '
[email protected]')->first();
+ $this->visit('/password/reset/' . $reset->token)
+ ->see('Reset Password')
+ ->submitForm('Reset Password', [
+ 'password' => 'randompass',
+ 'password_confirmation' => 'randompass'
+ ])->seePageIs('/')
+ ->see('Your password has been successfully reset');
+ }
+
+ public function test_reset_password_page_shows_sign_links()
+ {
+ $this->setSettings(['registration-enabled' => 'true']);
+ $this->visit('/password/email')
+ ->seeLink('Log in')
+ ->seeLink('Sign up');
+ }
+
/**
* Perform a login
* @param string $email
return $this->visit('/login')
->type($email, '#email')
->type($password, '#password')
- ->press('Sign In');
+ ->press('Log In');
}
}