Skip to content

Commit

Permalink
User account test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PSkierniewski committed Apr 3, 2016
1 parent cdfa7c4 commit 042e55d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/functional/AccountCest.php
Expand Up @@ -44,7 +44,7 @@ public function canChangeFirstNameAndLastName(FunctionalTester $I)
$I->canSee('Change password');
$token = $I->grabValueFrom("input[name='_token']");
$loggedUser = $I->grabRecord('Users', ['email' => 'john@doe.com']);
$I->sendAjaxRequest('PUT', '/en/api/v1/account/' . $loggedUser->id, ['firstName' => 'xxx', 'lastName' => 'yyy', '_token' => $token]);
$I->sendAjaxRequest('PUT', '/en/api/v1/account/' . $loggedUser->id, ['nickName' => 'JohnyD', 'firstName' => 'xxx', 'lastName' => 'yyy', '_token' => $token]);
$I->seeResponseCodeIs(200);
$I->amOnPage('/en');
$I->see('xxx yyy');
Expand All @@ -58,7 +58,7 @@ public function canChangePassword(FunctionalTester $I)
$I->canSee('Change password');
$token = $I->grabValueFrom("input[name='_token']");
$loggedUser = $I->grabRecord('Users', ['email' => 'john@doe.com']);
$I->sendAjaxRequest('PUT', '/en/api/v1/account/' . $loggedUser->id, ['password' => 'test124', 'password_confirmation' => 'test124', '_token' => $token]);
$I->sendAjaxRequest('PUT', '/en/api/v1/account/' . $loggedUser->id, ['nickName' => 'JohnyD', 'password' => 'test124', 'password_confirmation' => 'test124', '_token' => $token]);
$I->seeResponseCodeIs(200);
$I->logout();
$I->login('john@doe.com', 'test124');
Expand All @@ -72,7 +72,7 @@ public function canNotChangePasswordWithoutConfirmation(FunctionalTester $I)
$I->canSee('Change password');
$token = $I->grabValueFrom("input[name='_token']");
$loggedUser = $I->grabRecord('Users', ['email' => 'john@doe.com']);
$I->sendAjaxRequest('PUT', '/en/api/v1/account/' . $loggedUser->id, ['password' => 'test124', '_token' => $token]);
$I->sendAjaxRequest('PUT', '/en/api/v1/account/' . $loggedUser->id, ['nickName' => 'JohnyD', 'password' => 'test124', '_token' => $token]);
$I->seeResponseCodeIs(400);
}

Expand Down

0 comments on commit 042e55d

Please sign in to comment.