Исправлена ошибка при попытке отправить сообщение в форму обратной связи, будучи залогиненным

This commit is contained in:
ErickSkrauch
2017-11-01 19:56:23 +03:00
parent 9bdc9173c2
commit 85d109910f
2 changed files with 45 additions and 5 deletions

View File

@ -0,0 +1,37 @@
<?php
namespace tests\codeception\api\functional;
use tests\codeception\api\FunctionalTester;
class FeedbackCest {
public function testFeedbackWithoutAuth(FunctionalTester $I) {
$I->sendPOST('/feedback', [
'subject' => 'Test',
'email' => 'email@ely.by',
'type' => 0,
'message' => 'Hello world',
]);
$I->canSeeResponseCodeIs(200);
$I->canSeeResponseIsJson();
$I->canSeeResponseContainsJson([
'success' => true,
]);
}
public function testFeedbackWithAuth(FunctionalTester $I) {
$I->amAuthenticated();
$I->sendPOST('/feedback', [
'subject' => 'Test',
'email' => 'email@ely.by',
'type' => 0,
'message' => 'Hello world',
]);
$I->canSeeResponseCodeIs(200);
$I->canSeeResponseIsJson();
$I->canSeeResponseContainsJson([
'success' => true,
]);
}
}