Skip to content

Commit

Permalink
Add test to create cest
Browse files Browse the repository at this point in the history
  • Loading branch information
KoukiFactori committed Feb 15, 2023
1 parent c2a93cb commit 9c3fff1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Api/Rating/RatingCreateCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,20 @@ public function postRatingAgain(ApiTester $I): void
]);
$I->seeResponseCodeIs(422);
}

public function postRatingForSomeoneElse(ApiTester $I): void
{
$target = UserFactory::createOne(); //User we want to use for post

$bookmark = BookmarkFactory::createOne();
$user = UserFactory::createOne(['login' => 'user1', 'password' => 'test'])->object();
$I->amLoggedInAs($user);

$I->sendPost('/api/ratings', [
'user' => '/api/users/' . $target->getId(),
'bookmark' => '/api/bookmarks/' . $bookmark->getId(),
'value' => 5
]);
$I->seeResponseCodeIs(422);
}
}

0 comments on commit 9c3fff1

Please sign in to comment.