mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-03 20:56:21 +00:00
Covered everything in the user controller except configuration controlled statements.
This commit is contained in:
@@ -53,18 +53,11 @@ class UserControllerCest
|
||||
*/
|
||||
public function logout(FunctionalTester $I)
|
||||
{
|
||||
$I->amLoggedAs(['email' => 'thegrumpydictator@gmail.com', 'password' => 'james']);
|
||||
$I->wantTo('logout');
|
||||
#$I->amOnPage('/logout');
|
||||
#$I->am
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function postLogin(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('post login');
|
||||
$I->amOnRoute('login');
|
||||
$I->amOnPage('/');
|
||||
$I->click('Logout');
|
||||
$I->see('Firefly III — Sign In');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,14 +65,23 @@ class UserControllerCest
|
||||
*/
|
||||
public function postRegister(FunctionalTester $I)
|
||||
{
|
||||
// @codingStandardsIgnoreStart
|
||||
$I->wantTo('post-register a new account');
|
||||
$I->amOnPage('/register');
|
||||
$token = $I->grabValueFrom('input[name=_token]');
|
||||
$I->submitForm('#register', ['email' => 'noreply@gmail.com', '_token' => $token]);
|
||||
$I->submitForm('#register', ['email' => 'noreply@gmail.com']);
|
||||
$I->see('Password sent!');
|
||||
$I->seeRecord('users', ['email' => 'noreply@gmail.com']);
|
||||
// @codingStandardsIgnoreEnd
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function postRegisterFail(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('post-register a new account and fail');
|
||||
$I->amOnPage('/register');
|
||||
$I->submitForm('#register', ['email' => 'XXxxxxx']);
|
||||
$I->see('Input invalid, please try again: The email must be a valid email address.');
|
||||
$I->dontseeRecord('users', ['email' => 'XXxxxxx']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,6 +91,19 @@ class UserControllerCest
|
||||
{
|
||||
$I->wantTo('get a password reminder');
|
||||
$I->amOnRoute('remindme');
|
||||
$I->submitForm('#remindme', ['email' => 'functional@example.com']);
|
||||
$I->see('You\'re about to get an e-mail.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function postRemindmeFail(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('get a password reminder and fail');
|
||||
$I->amOnRoute('remindme');
|
||||
$I->submitForm('#remindme', ['email' => 'abcdee']);
|
||||
$I->see('No good!');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,6 +124,17 @@ class UserControllerCest
|
||||
{
|
||||
$I->wantTo('reminded of my password');
|
||||
$I->amOnRoute('remindme');
|
||||
$I->see('Firefly III — Reset your password');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function resetFail(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('reset my password and fail');
|
||||
$I->amOnPage('/reset/123');
|
||||
$I->see('Yo no hablo reset code!');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,7 +143,8 @@ class UserControllerCest
|
||||
public function reset(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('reset my password');
|
||||
$I->amOnRoute('reset');
|
||||
$I->amOnPage('/reset/okokokokokokokokokokokokokokokok');
|
||||
$I->see('You\'re about to get an e-mail.');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user