Skip to content

Commit

Permalink
Add test for post without user
Browse files Browse the repository at this point in the history
  • Loading branch information
KoukiFactori committed Feb 15, 2023
1 parent 7b7a93e commit ccd94c5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Api/Rating/RatingCreateCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,18 @@ public function postRatingForSomeoneElse(ApiTester $I): void
]);
$I->seeResponseCodeIs(422);
}

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

$I->sendPost('/api/ratings', [
'bookmark' => '/api/bookmarks/'.$bookmark->getId(),
'value' => 5,
]);

$I->seeResponseCodeIs(201);
}
}

0 comments on commit ccd94c5

Please sign in to comment.