From 7abeebe17e12ca1e10467382e6bcae3ab77b666c Mon Sep 17 00:00:00 2001 From: IanM Date: Wed, 31 Jan 2024 11:49:25 +0000 Subject: [PATCH] ensure poll is associated with postId --- tests/integration/api/CreatePollTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/integration/api/CreatePollTest.php b/tests/integration/api/CreatePollTest.php index df862df4..0ae4a521 100644 --- a/tests/integration/api/CreatePollTest.php +++ b/tests/integration/api/CreatePollTest.php @@ -257,6 +257,13 @@ public function authorized_user_can_create_post_poll_on_api(int $userId) $attributes = $data['attributes']; $this->assertEquals('Add a poll to an existing post', $attributes['question']); + + $pollId = $data['id']; + $this->assertNotNull($pollId); + + $poll = Poll::find($pollId); + $this->assertNotNull($poll); + $this->assertEquals(1, $poll->post_id); } /**