Мигрирована логика блокировки аккаунтов

This commit is contained in:
ErickSkrauch
2016-08-22 00:09:14 +03:00
parent b57b015f66
commit 72a7f743be
5 changed files with 22 additions and 7 deletions

View File

@ -8,7 +8,6 @@ use Codeception\Specify;
use common\models\Account;
use tests\codeception\api\unit\DbTestCase;
use tests\codeception\common\fixtures\AccountFixture;
use Yii;
/**
* @property AccountFixture $accounts
@ -84,6 +83,14 @@ class LoginFormTest extends DbTestCase {
expect($model->getErrors('login'))->equals(['error.account_not_activated']);
});
$this->specify('error.account_banned if account has banned status', function () {
$model = $this->createModel([
'account' => new AccountIdentity(['status' => Account::STATUS_BANNED]),
]);
$model->validateActivity('login');
expect($model->getErrors('login'))->equals(['error.account_banned']);
});
$this->specify('no errors if account active', function () {
$model = $this->createModel([
'account' => new AccountIdentity(['status' => Account::STATUS_ACTIVE]),