Skip to content

Commit

Permalink
Test: add delete question by user
Browse files Browse the repository at this point in the history
  • Loading branch information
emost22 committed Jun 20, 2024
1 parent 448641c commit 452f012
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,17 @@ void init() {
assertThat(questionEntity.getPinUpdatedTime()).isEqualTo(savedQuestion.getPinUpdatedTime());
assertThat(questionEntity.getExperienceId()).isEqualTo(savedQuestion.getExperienceId());
}

@Test
void 질문_삭제_user_테스트() {
// given
questionRepository.deleteByUserId(savedUser.getUserId());

// when
QuestionEntity questionEntity =
questionRepository.findTopByUserIdOrderByCreateTimestampDesc(savedUser.getUserId());

// then
assertThat(questionEntity).isNull();
}
}

0 comments on commit 452f012

Please sign in to comment.